I am making a program that will need to print a lot of hints and in order to avoid repetition and make it more interesting, I want the program to pick those hints randomly from lists that I am going to make. I also want to remove a hint after being used so the program doesn't use it again in a place that it won't need to. Can someone show an example of that on this code:
import random
foo = ['a', 'b', 'c', 'd', 'e']
print(random.choice(foo))
Aucun commentaire:
Enregistrer un commentaire