Re: "Thinking like CS" problem I can't solve

2006-05-23 Thread gry
Alex Pavluck wrote: > Hello. On page 124 of "Thinking like a Computer Scientist". There is > an exercise to take the following code and with the use of TRY: / > EXCEPT: handle the error. Can somone help me out? Here is the code: > > def inputNumber(n): > if n == 17: > raise 'BadNumb

Re: "Thinking like CS" problem I can't solve

2006-05-23 Thread gry
Alex Pavluck wrote: > Hello. On page 124 of "Thinking like a Computer Scientist". There is > an exercise to take the following code and with the use of TRY: / > EXCEPT: handle the error. Can somone help me out? Here is the code: > > def inputNumber(n): > if n == 17: > raise 'BadNumb

Re: "Thinking like CS" problem I can't solve

2006-05-23 Thread Mel Wilson
Alex Pavluck wrote: > Hello. On page 124 of "Thinking like a Computer Scientist". There is > an exercise to take the following code and with the use of TRY: / > EXCEPT: handle the error. Can somone help me out? Here is the code: > [ ... ] What error? Python 2.4.2 (#1, Jan 23 2006, 21:24:54) [

"Thinking like CS" problem I can't solve

2006-05-23 Thread Alex Pavluck
Hello. On page 124 of "Thinking like a Computer Scientist". There is an exercise to take the following code and with the use of TRY: / EXCEPT: handle the error. Can somone help me out? Here is the code: def inputNumber(n): if n == 17: raise 'BadNumberError: ', '17 is off limits.'