创建一个程序,告诉您离开家时是否需要雨伞。未接收输出,而是接收出口代码0
我正在尝试创建一个程序,该程序最终告诉您是否需要雨伞(一个非常简单的程序),我只需要是/否输出。但是,这是我使用的代码,我根本没有输出。我只能获得退出代码0,我需要修复什么,以便收到输出以及退出代码0?
感谢您的帮助。新手在这里。
weather = input('Is it raining today? option Yes/No')
if weather == 'Yes':
print('Bring an umbrella')
if weather == 'No':
print('No umbrella needed')
I am trying to create a program that ultimately tells you if you need an umbrella (a very simple program) I only need a Yes/No output. However, this is the code I have used and I am not getting an output at all. I am only getting exit code 0, what do I need to fix it so that I receive the output as well as exit code 0?
Thank you for your help. Newbie here.
weather = input('Is it raining today? option Yes/No')
if weather == 'Yes':
print('Bring an umbrella')
if weather == 'No':
print('No umbrella needed')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
修复凹痕并使用
elif
:Fix the indentation and use
elif
: