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

Python

Vuk Spasojevic
Vuk Spasojevic
9,491 Points

Why this in not working, although solution is correct

def covers_all(topics):
    covers_list_all = []
    for key in COURSES:
        if COURSES[key].intersection(topics) == topics:
            covers_list_all.append(key)
        else:
            continue
    return covers_list_all

[MOD: added ```python formatting -cf]

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,389 Points

You are correct, in that this code passes Task 2. Have you altered the covers function that prevents Task 1 from passing?

Post back if you still need help on this challenge.

Vuk Spasojevic
Vuk Spasojevic
9,491 Points

Dear Chris, yes, problem was with task 1, i accidentally deleted ":" at the end of if statement. Thanks again for help. Your help is much appreciated. Best regards