weather advisory

Question

Write a program to give an advisory if the weather is sunny, rainy, or cold. But no advisory for any other input.

in progress 0
YashikaKhurana 55 years 2 Answers 731 views Master 0

Answers ( 2 )

  1. 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

  2. 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

Leave an answer

Browse
Browse