Premium Only Content

For Loop with Multiple Lists |Section 4|Celestial Warrior
In one of the previous exercises we created the following function that gets Celsius degrees as input and returns Fahrenheit, or a message if the Celsius inputvalue is less than -273.15.
def c_to_f(c):
if c< -273.15:
return "That temperature doesn't make sense!"
else:
f=c*9/5+32
return f
Please implement a for loop that iterates through the following temperatures list temperatures=[10,-20,-289,100]and calls the above c_to_f function in each iteration. In other words, this timeyou are using the function to calculatea series of values instead of just one value.
The expected output:
50.0
-4.0
That temperature doesn't make sense!
212.0
temperatures=[10,-20,-289,100]
def c_to_f(c):
if c< -273.15:
return "That temperature doesn't make sense!"
else:
f=c*9/5+32
return f
for t in temperatures:
print(c_to_f(t))
-
LIVE
Major League Fishing
4 days agoLIVE Tackle Warehouse Invitationals, Stop 5, Day 3
1,231 watching -
LIVE
GritsGG
1 hour agoWSOW Qualifiers! 👑 2587+ Ws
180 watching -
1:12:12
Right Side Broadcasting Network
14 hours agoLIVE REPLAY: Defense Secretary Pete Hegseth and Gen. Dan Caine Hold a Pentagon Press Briefing - 6/22/25
132K226 -
LIVE
Sgt Wilky Plays
1 hour agoMorning Coffee and Karting
42 watching -
58:09
Barry Cunningham
5 hours agoLIVE: Defense Secretary Pete Hegseth & Gen. Dan Caine Hold a Pentagon Press Briefing On Iran Bombing
61K174 -
LIVE
TonYGaMinG
1 hour ago🟣 QUESTING TRYIN TO GET READY FOR DEEP DESERT #RumbleGaming
45 watching -
LIVE
TheItalianCEO
3 hours agoPlaying video game is better than touching grass
125 watching -
3:41:59
LumpyPotatoX2
4 hours ago[UPDATE 2.4] Hunt: Showdown | Sunday Solo Runs - #RumbleGaming
14.8K2 -
2:12:01
Amish Zaku
4 hours agoVariety Stream
8K2 -
23:51
Adam Does Movies
22 hours ago $1.44 earned28 Years Later - Movie Review
22.3K9