【发布时间】:2011-10-09 10:18:19
【问题描述】:
我是一个初学者,一直在看http://en.wikibooks.org/wiki/Python_Programming/Conditional_Statements,但我无法理解这里的问题。这很简单,如果用户输入 y 它应该打印这将进行计算,尽管我在 IF answer=="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()
【问题讨论】:
-
下面的答案应该对您有所帮助。但看起来您可能需要从头开始并遵循编程教程。最好在潜入之前学习基础知识!
标签: python conditional-statements