Welcome to the Treehouse Community
Looking to learn something new?
Jaleel Rivera1,338 Points
How could i make this code better
I answered the question but I wanted to know how could I solve this problem more efficiently
def covers_all(topics): topics_covered =  counter = 0 for x in COURSES: counter = 0 for y in topics: if y in COURSES[x] counter += 1 if counter == len(topics): topics_covered.append(x) return topics_covered
Steven Parker221,328 Points
While counting in nested loops does produce the same results, I think the point of the exercise was to practice using sets and set math operations. The previous video had examples that could be applied here.