我目前正在研究一个python项目,我需要它接受来自用户的随机输入。如何使python接受随机输入
所以,如果我有,例如:
def question_one() :
answer_one = raw_input ('How many days are there in a week? ').lower()
try:
if answer_one == 'seven' or answer_one == '7' :
question_2()
一切工作的奇迹。但如何才能让蟒蛇接受随机输入,如
def question_two() :
answer_two = raw_input ('What´s your mother´s name? ').lower()
try:
if answer_two == ***I have no idea how to code this part*** :
question_3()
在这种情况下,我需要Python来接受任何输入,并且仍然将用户带到下一个问题。我怎么能这样做?
非常感谢,认为没有的伎俩! –