可以说我有以下内容:
foo = ('animal', 'vegetable', 'mineral')
我希望能够从列表中随机选择然后,根据选择的一个,有一组命令要遵循。
例如,如果 'animal' 是随机选择的,我想要消息 print('rawr I\'ma tiger'),或者如果它是 'vegetable' print('Woof, I'm a carrot') 或其他内容。
我知道随机选择它是:
from random import choice
print choice(foo)
但我不想打印选择,我希望它是秘密的。请帮忙。