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.
#2
I wouldn't use a list here. I would recommend removing the first line. In the third line, i would replace answer with 'yes'. Then in the fourth line, you could use .lower() to make all types of 'yes' to be recognized by the test in the while loop, whether it is with lowercase or uppercase.
Something like this:

userinput = ('')
while userinput != 'yes':
    userinput = input("Do you need help? ").lower()
print("Heres your work!")
Reply


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

Forum Jump:

User Panel Messages

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