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! While you're at it, check out some resources Treehouse students have shared here.

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

Python Functional Python Functional Workhorses Map and Filter Comprehension

Pedro Pólvora
Pedro Pólvora
14,086 Points

Isn't this a list comprehension?

In the last task, converting temperatures from C to F: I get the output correct when I compile it locally.. and I 'think' I'm using a list comprehension.. however, my answer is rejected.

What am I doing wrong ?

good_temps=[ c_to_f(temp) if ((temp>=9) and (temp <=32.6)) else temp for temp in temperatures]

1 Answer

Pedro Pólvora
Pedro Pólvora
14,086 Points

Problem solved...I did not understand that I was suppose to have only the changed temperatures in