Welcome to the Treehouse Community
Looking to learn something new?
Laknath Gunathilake1,860 Points
can't seem to pass this challenge. says expected 2 but got 0
def members(my_dict, my_list): count =0 for item in my_dict: if item in my_dict == item in my_list: count+= 1 return count
Kourosh Raeen23,732 Points
Hi Laknath - Try looping over the list of keys:
for key in my_list:
Then check to see if the current key is a key in the dictionary:
if key in my_dict:
Also, make sure the return statement has the right indentation. It shouldn't be in the if or for block.