Aug-14-2018, 04:49 PM
(This post was last modified: Aug-14-2018, 05:37 PM by ichabod801.)
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 ?