[Tutor] problem

Allen John Schmidt, Jr. ajschmidt at fredericksburg.com
Tue May 3 16:43:53 CEST 2005


Feziwe Mpondo wrote:

>hi
>problem :modification of a guessing game excersize to a password asking 
>program. her's what i tried.
>s = raw_input
>  
>
What is this here for?

>#asks for a password
>#prints it if correct
>password = input( "Tell me a password: ")
>  
>
This is correct, but

>password ==dal
>    print password,"Tell me a password: "
>elif password ==dal
>    print "accurate"
>  
>
should be:
    if password!="dal":   
        print password,"Tell me a password: "
    elif password=="dal":
        print "accurate"

>while password != flower :
>    password = input ("tell me a password: ")
>  
>
And here you should have flower as "flower", since you are checking a 
string.

Hope that helps!


More information about the Tutor mailing list