0

Just started teaching myself python today. But cant figure out how to use an else statement to loop back to a previous raw_input

print "Please enter your name below so I may know what to call you."
time.sleep(3)
name = raw_input("Name:")
time.sleep(1)
print "Your name is %s, correct?" % (name)
time.sleep(2)
verify = raw_input()
  if verify = "yes":
    print "Hello %s, it is very nice to meet you." % (name)

  else:
  • Welcome to the world of Python. First of all `verify = "yes"` is an assignment. What you need is `if verify == "yes":` Now, your `else` would be executed when verify is not equal to `yes` – karthikr Jan 02 '17 at 06:20
  • 1
    You have a long and winding road to go. For starters, read about `for` and `while` loops. – DYZ Jan 02 '17 at 06:20
  • Use '==' instead of '=' in if loop – Vee Mandke Jan 02 '17 at 06:22

0 Answers0