002 - Common list elements

002 - Common list elements#

Write a simple implementation for the following function to find common elements between two lists:

def find_common_elements(list1, list2):
    common_elements = []
    # ... implement here ...
    return common_elements

# Test the function
list_a = [1, 2, 3, 4, 5]
list_b = [4, 5, 6, 7, 8]
common = find_common_elements(list_a, list_b)
print(common)