Python Forum
Need help !!! Loop is not moving
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help !!! Loop is not moving
#1
print("Help! My computer doesn't work!")
done = False
while not done:
    print("Does the computer make any sounds (fans, etc.) ")
    choice = (input("or show any lights? (y/n):"))
if choice == "n":
    choice = input("Is it plugged in? (y/n):")
if choice == 'n':
    print("Plug it in.")
else:
    choice = input("Is the switch in the \"on\" position? (y/n):")
if choice == 'n':
    print("Turn it on.")
else:
    choice = input("Does the computer have a fuse? (y/n):")
if choice == 'n':
    choice = input("Is the outlet OK? (y/n):")
if choice == 'n':
    print("Check the outlet's circuit ")
    print("breaker or fuse. Move to a")
    print("new outlet, if necessary. ")
else:
    print("Please consult a service technician.")
    done = True
------------------------------------------------------------
Output ---- Not moving to next if loop , it keep on asking the same
Output:
Help! My computer doesn't work! Does the computer make any sounds (fans, etc.) or show any lights? (y/n):n Does the computer make any sounds (fans, etc.) or show any lights? (y/n):y Does the computer make any sounds (fans, etc.) or show any lights? (y/n):
------ > It suppose to ask "Is it plugged in? (y/n):" if i enter n in the choice , isn't ?
Reply


Messages In This Thread
Need help !!! Loop is not moving - by aankrose - Aug-14-2018, 04:49 PM
RE: Need help !!! Loop is not moving - by aankrose - Aug-14-2018, 05:54 PM
RE: Need help !!! Loop is not moving - by nilamo - Aug-14-2018, 05:59 PM
RE: Need help !!! Loop is not moving - by aankrose - Aug-14-2018, 07:07 PM

Forum Jump:

User Panel Messages

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