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)
![john larson](https://uploads.teamtreehouse.com/production/profile-photos/2747952/micro_black_and_white.jpg)
john larson
16,594 Pointsreturn a list of courses from COURSES where the supplied set and the course's value (also a set) overlap.
Not looking for the solution, I just want to know if I understand the question. I have what I think the point of the challenge is, commented out inside the function definition. Am I on the right track?
#these are the instructions
# write a function named covers
# that accepts a single parameter,
# a set of topics
# return a list of courses from COURSES
# where the supplied set
# and the course's value
# (also a set) overlap
# example, covers({"Python"})
# would return ["Python Basics"]
# .......................................................
def covers(topics): # topics = type set
list_of_courses = [] # the key for topics that overlap
# compare topics w/ dct value
# if topics and value overlap
# append key to list_of_courses
return list_of_courses
COURSES = { # type = dict
# key = type string value = type set
"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 Basics": {"PHP", "variables", "conditions",
"integers", "floats", "strings",
"booleans", "HTML"},
"Ruby Basics": {"Ruby", "strings", "floats",
"integers", "conditions",
"functions", "input"}
}
set_of_topics = {"boolean", "integers", "strings"}
# set of topics = type set
covers(set_of_topics)
1 Answer
![Umesh Ravji](https://secure.gravatar.com/avatar/decd387aa640da9f35ea98d0411098fa?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Umesh Ravji
42,386 PointsLogic looks alright to me :)
![Chris Freeman](https://uploads.teamtreehouse.com/production/profile-photos/1153532/micro_image.jpg)
Chris Freeman
Treehouse Moderator 68,425 PointsI agree. Moving comment to Answer. Marking Best Answer! Thanks Umesh Ravji!
john larson
16,594 Pointsjohn larson
16,594 PointsThanks Umesh for taking a look.