Re: [Tutor] Suggestions for while loop

2009-05-11 Thread David
Dave Angel wrote: def getTotalNumber(prompt): while True: try: numstr = raw_input(prompt) n = int(numstr) if 0 < n < 50:#some validation return n print "Number is not reasonable, try again" except ValueErro

Re: [Tutor] Suggestions for while loop

2009-05-10 Thread Richard Lovely
2009/5/11 David : > Hi, I am going through Wesley Chun's book and this is Exercise 8-11; > Write a program to ask the user to input a list of names, format "Last Name" > "comma" "First Name". Write a function that manages the input so that > when/if the user types in the names in the wrong format t

Re: [Tutor] Suggestions for while loop

2009-05-10 Thread Dave Angel
David wrote: Hi, I am going through Wesley Chun's book and this is Exercise 8-11; Write a program to ask the user to input a list of names, format "Last Name" "comma" "First Name". Write a function that manages the input so that when/if the user types in the names in the wrong format the err

[Tutor] Suggestions for while loop

2009-05-10 Thread David
Hi, I am going through Wesley Chun's book and this is Exercise 8-11; Write a program to ask the user to input a list of names, format "Last Name" "comma" "First Name". Write a function that manages the input so that when/if the user types in the names in the wrong format the error is corrected,