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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Duyen Huynh Ngoc Phuong](https://secure.gravatar.com/avatar/c4712f3a75cc1aedd0c3b53d4d508aa1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Duyen Huynh Ngoc Phuong
3,494 PointsCan you help me to figure what is wrong with my code. I cannot pass the challenge.
create something a bit more refined. Create a new function named covers_all that takes a single set as an argument. Return the names of all of the courses, in a list, where all of the topics in the supplied set are covered. For example, covers_all({"conditions", "input"}) would return ["Python Basics", "Ruby Basics"]. Java Basics and PHP Basics would be exclude because they don't include both of those topics.
def covers_all(single_set):
new_list = []
for key, value in COURSES.items():
if (single_set & value)==single_set:
new_list.append(key)
return new_list
COURSES = {
"Python Basics": {"Python", "functions", "variables",
"booleans", "integers", "floats",
"arrays", "strings", "exceptions",
"conditions", "input", "loops"},
"Java Basics": {"Java", "strings", "variables",
"input", "exceptions", "integers",
"booleans", "loops"},
"PHP B-asics": {"PHP", "variables", "conditions",
"integers", "floats", "strings",
"booleans", "HTML"},
"Ruby Basics": {"Ruby", "strings", "floats",
"integers", "conditions",
"functions", "input"}
}
def covers_all(single_set):
new_list = []
for key, value in COURSES.items():
if (single_set & value)==single_set:
new_list.append(key)
return new_list
def covers(arg):
hold = []
for key, value in COURSES.items():
if value & arg:
hold.append(key)
return hold
2 Answers
![Don Newcomb](https://uploads.teamtreehouse.com/production/profile-photos/7652812/micro_Tri_symbol.jpg)
Don Newcomb
4,755 PointsI looked at your problem and tried to pass it, but it would not pass do to the "-" you placed here "PHP B-asics": just change that to "PHP Basics": and it should work fine. that was the only thing I found wrong :)
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,274 PointsYou solution looks good. So I pasted it directly into the challenge and it passed. Does it not pass for you?
![Duyen Huynh Ngoc Phuong](https://secure.gravatar.com/avatar/c4712f3a75cc1aedd0c3b53d4d508aa1?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Duyen Huynh Ngoc Phuong
3,494 PointsYes, I tried it many times, the first challenge passed, but the second one did not.
![Duyen Huynh Ngoc Phuong](https://secure.gravatar.com/avatar/c4712f3a75cc1aedd0c3b53d4d508aa1?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Duyen Huynh Ngoc Phuong
3,494 PointsI have tried to log out of my account and logged in again. Luckily the solution is passed this time. Thank you
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,274 PointsDon found it .. a stray character somehow got inserted into the supplied data.
Steven Parker
230,274 PointsSteven Parker
230,274 PointsGood catch!
I didn't even think that the provided data might have been changed. I only pasted in the code portion.