Jump to content
Sign in to follow this  
newbee

multiple user input issue

Recommended Posts

x=input("choose number: 1,2,3,4\n")
if (x=="1"):
    y=input("choose letter: a,b,c,d\n") 
    if (y=="a"):
        print "hello"

can some one tell me what i am doing wrong here ?

 

Share this post


Link to post
Share on other sites

what you get from the input is a integer, but you try to compare x with a string.
just get rid of "" around the 1 and it should work

also it seems like you have to enter a, b, c or d with "" those things when the program asks you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×