Python · Output & Logging

Besides depth, which two pprint parameters control layout, and what are their defaults?

Answer locked. Get the free KnowCard app to reveal it — plus spaced-repetition review so it actually sticks.

Get it on App StoreGet it on Google Play

This is one card from the KnowCard library — thousands more across SAP, Linux, Python and more. In the app you get the answer, AI explanations, and cards that come back right before you would forget them. Free to start on iOS, Android or the web.

More in Output & Logging

In pprint, what does passing depth=2 do to a deeply nested structure?
What does this print (note the absence of any explicit newline)? ``` print("loading", end="") print("...done") ```
You want an error message to go to stderr, not stdout, so it doesn't mix with normal program output. How do you make print write to stderr?
A long-running loop prints progress with end="", but nothing appears on screen until the program finishes. Why, and what fixes it?
Why use pprint.pprint(obj) instead of print(obj) for a big nested list or dict?
You want pprint's nicely formatted output as a string (e.g. to log it or write to a file) rather than printed. Which function?

Start learning today

Free to start — download the app or use it in your browser.

Get it on App StoreGet it on Google Play