On 5/21/2010 5:35 AM, Norman Khine wrote:
hello,
i have this script, but i am stuck at the loop, if the user types an
incorrect database id:

http://paste.lisp.org/+25D3

how would i write the exception correctly?

Which line of code could raise the ValueError exception?

That line should be in the try block.

I also suggest unique error messages. If the user does not enter a number tell him so.

Also you need a way to break out of the loop once user enters a valid key.

Consider using the isdigit function to test the input instead of an exception.

--
Bob Gailer
919-636-4239
Chapel Hill NC

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to