Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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.