vendredi 19 mars 2021

How do I make it so that the outcome of the die decides what happens in an if statement?

How do I make it so this code is executed correctly? It just prints the first "print", and then exits the code.

import time
from random import randint

print("Rollig the dice...")
time.sleep(1.1)
print("You rolled",randint(1,9))

if randint(1, 5):
    print("IF BELOW 5 SOMETHING HAPPENS HERE")
else:
    print("IF OVER 5 SOMETHING HAPPENS HERE")



Aucun commentaire:

Enregistrer un commentaire