I am trying to retrieve a random string from python list to build a word guess challenge. I deployed anaconda environment on Alibaba Cloud ECS Instance.
I often use the following method to retrieve a random string from the list.
Let's say
WordStack=['A','B','C','D']
print(WordStack[random.randint(len(WordStack))])
Is there any optimized way or build-in funtion to do that? Due to a large number of words, it takes some time to give the result.