+ 1
why wont it randomize?
import random lst=["A", "B"] random.choice(lst) A=print("......") B=print("#....")
1 Réponse
0
Right now you're just assigning A and B to nothing because you're using the print() function (always returns None).
If you wanted A and B to be random, you could do:
A = random.choice(lst)
B = random.choice(lst)
random.choice returns (basically what the function equals in a way) a random choice from the list, so by assigning the variables to it, you get a random element