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
Right Side Broadcasting Network
5 hours agoLIVE: President Trump Signs a Presidential Memorandum - 9/15/25
2,564 watching -
LIVE
Sean Unpaved
2 hours agoTurf Tumbles & Triumphs: Burrow's Setback, Chiefs' Crumble, Irish Iced, & Kelly's 3-0
209 watching -
2:06:51
The Charlie Kirk Show
2 hours agoVice President JD Vance Remembers Charlie Kirk | Miller, Tucker, RFK Jr., Wiles, Leavitt | 9.15.25
1.28M1.09K -
LIVE
Major League Fishing
5 days agoLIVE! - Fishing Clash Team Series: Heritage Cup - Day 2
427 watching -
1:08:54
Simply Bitcoin
3 hours ago $0.46 earnedNEW REPORT SUGGESTS THE BITCOIN SUPPLY SHOCK IS ACCELERATING?! | EP 1332
8.08K -
10:31
Dr. Eric Berg
3 hours ago13 Foods You Should Never Buy Organic
56.7K19 -
15:10
SB Mowing
1 month agoShe had TEARS OF JOY on her face - An update on Beth
44K34 -
LIVE
Lofi Girl
3 years agolofi hip hop radio 📚 - beats to relax/study to
330 watching -
2:15:26
Nikko Ortiz
3 hours agoLIVE - Farm Animals Attack!
209K7 -
9:30
Sugar Spun Run
6 hours ago $1.49 earnedBlack and White Cookies
113K1