jesmet / arcane

4 stars 0 forks source link

Day 2 #1

Open jesmet opened 1 day ago

jesmet commented 1 day ago

elif statement

Write a Python program that takes the current temperature as input and suggests an activity based on the following criteria:

Temperature Below 0

"Stay indoors and drink hot chocolate."

Temperature between 0 to 10

"Wear warm clothes and go for a walk."

Temperature between 11 to 20

"Perfect weather for a picnic."

Temperature between 21 to 30

"Great day for a beach trip!"

Temperature Above 30

"Stay cool and hydrated indoors."

Hashimjr commented 21 hours ago

t=int(input("enter the current temperature")) If t<0: print("stay indoors and drink hot choclate") elif 0>=t and t<=10: print("wear warm clothes and go for a walk ") elif 11>=t and t>=20: print("perfect weather for picnic ") elif 21<=t and t>=30: print("great day for beach trip") else: print("stay cool and hydrated inside")

Farsana-ms-EC commented 5 hours ago

Temp=int(input("enter the temperature ")) If temp<0: Print('stay indoor and drink hot chocolate ') elif temp>0 and temp<10: Print('wear warm clothes and go for a walk') elif temp>10 and temp<20: Print('perfect weather for a picnic') elif temp>21 and temp<30: Print('great day for a beach') else: Print('stay cool and hydrated indoors')

FarisKRasheed commented 3 hours ago

t=int(input("enter the current temperature")) If t<0: print("stay indoors and drink hot choclate") elif 0>=t and t<=10: print("wear warm clothes and go for a walk ") elif 11>=t and t>=20: print("perfect weather for picnic ") elif 21<=t and t>=30: print("great day for beach trip") else: print("stay cool and hydrated inside")