[Tutor] if statement

Jeremy G Clark jeremy.clark at ucr.edu
Fri Jun 10 22:25:40 CEST 2011


Sorry, jumping in on this thread a couple days late...

Steven's suggestion is how I figured out a similar problem recently.  If you're executing the code through a windows command line, you might be getting the carriage-return character returned to the program (this behavior doesn't happen in IDLE).  Remove it by using rstrip like so:

password = input("Enter your password: ").rstrip('\r')

Jeremy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110610/9d1a0e33/attachment.html>


More information about the Tutor mailing list