小编Jan*_*oe2的帖子

从1到8猜数字

我的程序需要通过只询问3个问题来猜测用户的号码(从1到8).它正确地打印了前两个问题,但是当我按Enter键进入第三个问题时,它只打印我做的最后一个输入.如何使所有输入(是或否)小写?

# Simple Expert System
#firstQuestion = prstr(firstQuestion.lower()) 

print("Think of a number between 1 and 8.")

firstQuestion = (raw_input("Is it an even number? "))
secondQuestion = "Is it less than or equal to 4? "
thirdQuestion = "Is it less than or equal to 3? "
fourthQuestion = "Is it less than 3? "
fifthQuestion = "Is it greater than 6? "
sixthQuestion = "Is it greater than 5? "
seventhQuestion = "Is it less than 2? "




if firstQuestion …
Run Code Online (Sandbox Code Playgroud)

python if-statement python-2.7 python-3.x

0
推荐指数
1
解决办法
107
查看次数

标签 统计

if-statement ×1

python ×1

python-2.7 ×1

python-3.x ×1