len([x for x in list1 if x in list2])
Here is what the above code is Doing:
1. We create a list of all the words in list1 that are in list2.
2. We count the number of words in that list.
3. We return that number.
len([x for x in list1 if x in list2])
Here is what the above code is Doing:
1. We create a list of all the words in list1 that are in list2.
2. We count the number of words in that list.
3. We return that number.