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))
-
2:30:00
Badlands Media
11 hours agoDevolution Power Hour Ep. 392: Psyops, Paper Tigers, and the Path to Sovereignty
69.8K9 -
3:02:08
TimcastIRL
6 hours agoLeftist Terror Attack On ICE In Dallas, Jimmy Kimmel Doubles Down Insulting MAGA | Timcast IRL
337K136 -
1:17:35
Man in America
11 hours agoIs Starlink RIPPING Us Apart from the Inside Out? w/ Cory Hillis
41K14 -
55:40
TheSaltyCracker
5 hours agoIdiots Chug Tylenol PT2 ReeEEStream 9-24-25
80.1K216 -
Akademiks
6 hours agoYoung Thug Dissing YFN Lucci. Ready to Go back to Jail. Offset vs Cardi b
47.4K2 -
7:07
Colion Noir
14 hours agoCalifornia Just Banned All Glocks
47.6K38 -
Adam Does Movies
7 hours ago $0.90 earnedTalking Movies + Ask Me Anything - LIVE
39K1 -
1:23:56
Jamie Kennedy
5 hours agoChoosing Good in a World Gone Dark | Ep 223 HTBITY with Jamie Kennedy
33.9K6 -
DVR
SpartakusLIVE
8 hours ago#1 Challenge CHAMPION of WZ || Ridin' The GRAVY Train w/ GloryJean
73.4K1 -
The Pascal Show
4 hours ago $1.09 earnedDISTURBING UPDATES! New Developments In The D4vd Celeste Case... Possible Celeste Sighting?!
25.8K2