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))
-
59:45
VINCE
2 hours agoRFKage Match! Kennedy Destroys Corrupt Senators In Wild Hearing | Episode 119 - 09/05/25
56.3K57 -
LIVE
LFA TV
4 hours agoLFA TV ALL DAY STREAM - FRIDAY 9/5/25
3,825 watching -
LIVE
Benny Johnson
1 hour agoBiden Appears With MASSIVE Scar on Face, New Health Horror Revealed! Sobbing Jimmy Kimmel FLEEING US
4,265 watching -
LIVE
The Big Migâ„¢
3 hours agoBig Pharma's Puppets: RFK Jr. Takes on Congress
8,235 watching -
LIVE
Total Horse Channel
11 hours ago2025 Reno Snaffle Bit Futurity | Friday
17 watching -
26:40
Rethinking the Dollar
1 hour agoPeter Schiff: "Trump's Economy WORSE Than Biden" | Morning Check-In: Let's Talk...
151 -
LIVE
Badlands Media
7 hours agoBadlands Daily: September 5, 2025
4,230 watching -
24:00
Bearing
3 hours agoThe Week LIBERALS Thought TRUMP DIED 💥 (And Went INSANE) 🤣
3.56K11 -
LIVE
GritsGG
1 hour agoWin Streaking!! 🫡!
39 watching -
1:41:36
Dear America
2 hours agoWelcome To The Dept Of WAR! RFK DESTROYS The CDC! + Should Trans Own Guns?!
71.1K51