【发布时间】:2016-02-13 13:56:03
【问题描述】:
我一直在学习用 python 编写代码,并且我想出了一个好主意来编写一个程序。依据如下:
if input() == 'unnamed variable':
print('this')
if input() == 'another unnamed variable'
print('this other response')
如果不先满足第一个 if 语句,我不能输入另一个未命名的变量
我希望我的程序根据输入打印一些不同的内容供用户阅读
如何使用连续的 if 语句?我试过 elif 和其他。我可以背靠背说出 80 个 if 语句吗?
任何帮助将不胜感激,在此先感谢
【问题讨论】:
-
这取决于您到底想做什么,但您可以使用循环并将
continue语句放入条件句中。
标签: python-3.x console-application