小编use*_*084的帖子

如果python中的字符串语句?

我是一个初学者,一直在看http://en.wikibooks.org/wiki/Python_Programming/Conditional_Statements,但我无法理解这里的问题.这很简单,如果用户输入y它应该打印这将进行计算虽然我在IF回答= ="y"时出现语法错误

answer = str(input("Is the information correct? Enter Y for yes or N for no"))
proceed="y" or "Y" 
If answer==proceed:
print("this will do the calculation"):
else:
exit()
Run Code Online (Sandbox Code Playgroud)

python conditional-statements

16
推荐指数
4
解决办法
32万
查看次数

标签 统计

conditional-statements ×1

python ×1