0
Why does this code not work?
Why does this code not work?: import random for i in range(1): value=random.randint(1,8) if value=1: print(threat)
3 Answers
+ 2
Put indent and use == for condition
+ 1
Put the indent on the print(threat)
The code would be:
import random
for i in range(1):
value=random.randint(1,8)
if value=1:
print(threat)
+ 1
the if statement should have double equals sign for it i.e.:
if value==1:
print(threat)



