newbee Posted May 19, 2018 Share Posted May 19, 2018 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 ? Quote Link to comment Share on other sites More sharing options...
3dome Posted May 20, 2018 Share Posted May 20, 2018 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 Quote Link to comment Share on other sites More sharing options...
newbee Posted May 21, 2018 Author Share Posted May 21, 2018 thanks 3dome Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.