0
while True:
    print("That is not a valid console type.")
    newconsole = input("Please specify the type - highgrade or lowgrade: ")
    if newconsole == "highgrade" or "lowgrade":
        break

if the newconsole is equal to the string "highgrade" or "lowgrade", it will exit out of the while loop. But When I type in a random string, somehow the break statement is triggered? I want to exit my while loop whenever the user inputs "highgrade" or "lowgrade"

That is not a valid console type.
Please specify the type - highgrade or lowgrade: random string

Process finished with exit code 0
CountDOOKU
  • 142
  • 8

0 Answers0