Anonymous Anonymous - 1 month ago
99 0

No description

Python

05 Help

#List overlaps between 2 lists as a 3rd list
__author__='adityasharma'

list_1=input("Enter the first list:")
print("First List",list_1)

list_2=input("Enter the second list:")
print("Second List",list_2)

overlapList=[]

for num_1 in list_1:
    if num_1 in list_2:
        overlapList.append(num_1)

print(overlapList)

"""
OUTPUT

Enter the first list:123
First List 123
Enter the second list:234
Second List 234
['2', '3']
"""