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

Albert Lam
PLUS
Albert Lam
Courses Plus Student 6,317 Points

Lost and confused on this functional python challenge. List comprehension + map or filter?

I have been stuck on this question for awhile.

Correct me if I am wrong, but this is my list comprehension: [temp for temp in temperatures if temp <= 32.6 and temp >= 9]

I throw it into a filter like this: filter(c_to_f, [temp for temp in temperatures if temp <= 32.6 and temp >= 9]) or a map: map(c_to_f, [temp for temp in temperatures if temp <= 32.6 and temp >= 9])

I end up getting <map object at 0x0000000005500C50>, I think I am missing something here.

1 Answer

Albert Lam
PLUS
Albert Lam
Courses Plus Student 6,317 Points

The amount of coffee I knocked out just to understand what I did wrong.