How to Use Print in Jupyter Interactive Notebook for Better Debugging and Output?

20 Replies, 2048 Views

Hey! Love the tip about print in Jupyter interactive notebook. Another cool trick is using `print` with `assert` statements. Like, `assert x == y, print(f"x is {x}, y is {y}")`. It stops the code if the condition fails and shows you the values. Super handy for catching bugs early.

Also, check out `icecream` (pip install icecream). It’s like print but way more powerful for debugging.

Messages In This Thread



Users browsing this thread: 1 Guest(s)