I want to make a code that generates random numbers from 3 different choices that the user can pick from but the code just doesn't recognize the variable I put to represent those choices. Here is what I've got so far:
import random
choose = int(input("1, 2 or 3? "))
if choose == 1:
num == random.randint(1, 10)
elif choose == 2:
num == random.randint(10, 50)
elif choose == 3:
num == random.randint(1, 100)
else:
print("Invalid input")
print(num)
Can someone help?
Aucun commentaire:
Enregistrer un commentaire