So my code is basically simulating the at bats of a baseball player (Joe DiMaggio) in each game. This is the code so far
import random
i = random.randint(1, 100)
j = random.randint(1, 100)
k = random.randint(1, 100)
l = random.randint(1, 100)
while True:
if i <= 32:
i = 1
else:
i = 0
if k <= 32:
k = 1
else:
k = 0
if j <= 32:
j = 1
else:
j = 0
if l <= 32:
l = 1
else:
l = 0
m = i+j+k+l
print("He went", m, "-4")
I'm wondering if it would work with all of the different IF and ELSE statements. As well, when I try to run this, it highlights the m in the print statement with the error: Invalid Syntax.
Any help on how to fix this? Edit: The syntax error has been fixed, but now it only adds them up for the first time, the rest of the prints are all 4-4.