Pythonの例外処理

python-exception.png
try:
         x = int(raw_input("Please enter a number: "))
         break
except ValueError:
    print "Oops!  That was no valid number.  Try again..."

サポートサイト Wikidot.com