I am using a list to keep track of numbers and want to match up the lists index with a random number so I can subtract 1 from the value of that index.
import random
race_length = int(input("Choose the Length You Would Like You Race To Be
(Between 5 and 15)"))
dice = ["1", "2", "3", "4", "5", "6" ]
cars=[
["1", race_length],
["2", race_length],
["3", race_length],
["4", race_length],
["5", race_length],
["6", race_length],
]
while race_length >0:
print("Press Enter to Roll the Dice")
input()
chosen = int(random.choice(dice))
print(int(chosen))
What would I do so i can match the chosen match with the numbers in my list
Aucun commentaire:
Enregistrer un commentaire