import pprint my_dict = {"name": "John", "age": 30, "city": "New York"} pp = pprint.PrettyPrinter(indent=4) # Create a PrettyPrinter object with an indentation of 4 spaces pp.pprint(my_dict) # Use the pprint() method to pretty print the dictionary
import pprint my_dict = {"name": "John", "age": 30, "city": "New York"} pp = pprint.PrettyPrinter(indent=4) # Create a PrettyPrinter object with an indentation of 4 spaces pp.pprint(my_dict) # Use the pprint() method to pretty print the dictionary