You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To debug just add the following line to the Code cell where you want the debugger to start:
import pdb; pdb.set_trace()
For example, you would add it like this:
def unique_chars_hash(string):
import pdb; pdb.set_trace() # Start debugger when this line is hit
chars_set = set()
for char in string:
if char in chars_set:
return False
else:
chars_set.add(char)
return True
Then run both the Code and Unit Test cells (either through the menu "Cell", or through a shortcut such as [shift + enter] or [control + enter].
This will drop you into the pdb debugger where you can issue commands like the following to l(ist) the source code:
l
or n(ext):
n
For a list of all pdb commands, refer to this link.
Thank you for your awesome challenges.
I am new to python, I know there is
print
andpdb.set_trace()
.The text was updated successfully, but these errors were encountered: