Home Python Text Loop
Reply: 0

Python Text Loop

user668 Published in April 26, 2018, 5:20 pm

What I’m trying to do is when it gets to else and prints error I want it to loop back to choice1.

choice1 = input("Were would " + name + " like to go?\nThe Kitchen\nThe Couch\nOutside")
if choice1 == "The Kitchen":
  choices.append("The Kitchen")
  print(name + " walked towards The Kitchen.")
elif choice1 == "The Couch":
  choices.append("The Couch")
  print(name + " went and had sat on The Couch.")
elif choice1 == "Outside":
  print(name + " put on their pack and went out the door.")

If there’s an error/it reaches else I want it to loop back to choice1.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.394758 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO