Do I use random randint or random choice to random click on the list?
Question:
Answers:
Use the one that suits the format you have the elements in. If you have a list of the elements themselves, random.choice
is the better option; if you only have the number of elements, you might prefer random.randint
.
Use the one that suits the format you have the elements in. If you have a list of the elements themselves, random.choice
is the better option; if you only have the number of elements, you might prefer random.randint
.