Debugging Python with pdb or ipdb
Python has a wonderful debugger called
pdb you should use if you aren't already. If you're like me and prefer to not use an IDE, you could have a mess of
pdb. It makes debugging a far nicer experience.
Here's a little script I came up with to remove odd numbers from a list.
import unittest def remove_odd_numbers(): my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] for item in my_list: if item % 2 == 1: my_list ...