Exceptions
Try/except/raise
>>> while 1:
... try:
... x = int(raw_input("Please enter a number: "))
... break
... except ValueError:
... print "Oops! That was not valid. Try again"
...
Previous slide
Next slide
Back to first slide
View graphic version