Python Forum
Having two inputs to escape a while loop.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having two inputs to escape a while loop.
#1
For homework, ive been set a task to create a program which repeatedly asks the user if they need help. The question is asked over and over until the user either enters 'yes' or 'Yes'. I have tried everything to get it working. I just cant seem to get it to work... I have used square brackets to make a list under one variable containing 'yes' and 'Yes' i have even subsituted them for normal brackets... Help me please!

Heres the code: Loops arent my forté but its my best shot: My Document

answer = ["yes","Yes"]
userinput = (" ")
while userinput != answer:
    userinput = input("Do you need help?")
print("Heres your work!")
Reply


Messages In This Thread
Having two inputs to escape a while loop. - by Leo_Tovell - Jun-10-2019, 05:14 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020