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.

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.