Final answer:
To find common elements in two lists, use the set intersection operation and convert the resulting set back into a list.
Step-by-step explanation:
To create a function that finds common elements in two lists, you can use the set intersection operation. Here's the one-line code:
def find_common(list1, list2):
return list(set(list1) & set(list2))
In this code, we use the set() function to convert each list into a set, which eliminates duplicate elements. Then, we use the & operator to get the intersection of the two sets, which gives us the common elements. Finally, we convert the resulting set back into a list before returning it.