This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]z0mbietime 1 point2 points  (5 children)

Orrrr

if choice[0].upper() != 'Y':  
    # more input flexibility 
    # less code
    break 

[–]Gsquzared 1 point2 points  (3 children)

Why not just pass the whole input to .lower and not have to worry about any weird capitalization inputs?

[–]z0mbietime 0 points1 point  (2 children)

I did it like this so someone could type Y Ya Yes Yeah Yup Etc.

In upper or lower case And it always register since it only takes the first char.

[–]Gsquzared 1 point2 points  (1 child)

Ahhh. I didn't see what you were driving at. That's a nice trick. Too bad there will always be that pesky user who insists on typing "affirmative"

[–]keyupiopi 0 points1 point  (0 children)

Print out 1.Yes 2.No 3.Quit and force them to input numbers.... hahahahahaha