The danger of “except:”
What's wrong with this code:
try:
return self.children[O] # first child
except:
return None # no children
Solution:
except IndexError:
Previous slide
Next slide
Back to first slide
View graphic version