I am having some trouble getting break
to work in a while-loop.
I have created a function main()
which contains three input()
regarding global scopes, these three comes directly after each other. I want the program to end immediately if you enter an incorrect value into one of these ìnput()
and tried to accomplish that with break
without success. So the question is why can't I use break
in my while-loop?
Allowed values in my global scopes:
Scenario
1 or 2
games
should be greater than zero
board_size
3, 5 or 7
def main():
while True:
board_size = int(input("How big playing surface (3/5/7)? "))
if board_size != 3 or board_size != 5 or board_size != 7:
break
while True:
games = int(input("How many games do you want to simulate? "))
if games <1:
break
while True:
scenario = int(input('What scenario (1/2)? '))
if scenario != 1 or scenario != 2:
break
print_stats(games, scenario, board_size)