mercredi 3 mai 2023

How to make the r become 1 and stay like that [closed]

Whenever I repeat the loop, the r reverts back to 0. I want to keep it at 1 unless something else brings it back to 0.

r = 0
rand = random.randint(1,3)
if rand == 2:
   r = 1

print("r:" + str(r))



Aucun commentaire:

Enregistrer un commentaire