Creating a program that tells you whether or not you need an umbrella when you leave the house. Not receiving output, but receiving a exit code 0

Viewed 43

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')
1 Answers

Fix the indentation and use elif:

weather = input('Is it raining today? option Yes/No')
if weather == 'Yes':
    print('Bring an umbrella')
elif weather == 'No':
    print('No umbrella needed')
else:
    print('Type: Yes or No')

Related