有没有办法像整数一样随机化一组字符串?
我举个例子:
import random
random.randint(1, 30) #will produce random number between 1 and 30
对于一个字符串,我想从一组变量中随机化单词:
a="off","it","on","not"
random.randstr(a) #I understand that this isnt a real code and will produce and error
有没有一种简单的方法可以使这成为可能?