I'm following this book : And I'm up to chapter 11 (my bank account is fine, thanks). Could you look over this code and tell me where I'm going wrong?
It gives me the except: print all the time, and it doesn't even get as far as "Check 1 : x = "..
Tao Te Ching Discussions : Chapter 4 (includes links to previous chapters)
It gives me the except: print all the time, and it doesn't even get as far as "Check 1 : x = "..
Code:
def inputnumber():
x = input('Pick a number: ')
if x == 17:
raise 'BadNumberError', '17 is a bad number'
print "Check 1 : x = ",x
return x
def gimme():
try:
a = inputnumber()
except:
print "God doesn't like you today"
gimme()
Tao Te Ching Discussions : Chapter 4 (includes links to previous chapters)