Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Using a list comprehension
I'm still having challenges usinng thhe list comprehension syntax where on my code should I change? Or rather I should just restart everything
temperatures = [ 37, 0, 25, 100, 13.2, 29.9, 18.6, 32.8 ] def c_to_f(temp): """Returns Celsius temperature as Fahrenheit""" return temp * (9/5) + 32 good_temps = [temperature for temperature in map(c_to_f, temperatures) if temperature > 9 and temperature < 32.6]
Code challenge asks: "Convert each Celsius temperature into Fahrenheit, but only if the Celsius temperature is between 9 and 32.6."
But what you are doing is: "Convert each Celsius temperature into Fahrenheit, but keep the value only if the Fahrenheit temperature is between 9 and 32.6."
Hope it helps.