Share
weather advisory
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Write a program to give an advisory if the weather is sunny, rainy, or cold. But no advisory for any other input.
Answers ( 2 )
If you followed the tutorial, you must know!
weather=input(“How’s the weather ? “)
if(weather == “sunny”):
print(“Wear sunscreen”)
elif(weather == “cold”):
print(“Wear sweaters”)
elif(weather==”rainy”):
print(“Carry your umbrella”)
else:
pass
weather = input(“How is the weather today? :”).lower().strip()
if weather == “rainy”:
print(“Carry umbrella”)
elif weather ==”sunny”:
print(“Use Sunscreen”)
elif weather ==”cold”:
print(“Carry jackets”)
else:
pass