Forum Thread: Need Help with Code

This is the current code am working on its a simple code based on user input and if and else statements

age = raw_input("Enter your age: ")

name = raw_input("Enter your name: ")

ques = raw_input ("Is your input correct: ")

if ques = "Yes":
print ("You entered: ", age ,"for your age", name, "for your name")
print "Awaiting input"

'''I want the ques variable to be to return a true or false input from the user and later on the ques variable input to be used to execute the rest of the remaining code

open to suggestions the script wont work unless i disable the if and else statement and enable the print statement

3 Responses

Can't tell because this won't let you indent, but if you haven't then indent the two print statements in your if-else
Keep in mind that if they input "yes" or "y" then it will be counted as false

You should have 2 = for the if statement.

thank you i will try indenting

Share Your Thoughts

  • Hot
  • Active