Write a program to remove matching tuples and print it


Topic: Write a program to remove matching tuples and print it

Solution

test_list1 = [('Early', 'morning'), ('is','good'), ('for', 'Health')] 
test_list2 = [('Early', 'morning'), ('is','good')] 
l=[]
for i in range(0,len(test_list1)):
    for j in range(0,len(test_list2)):
        if test_list1[i]  not in test_list2:
           #continue
           l.append(test_list1[i])
           break
print(l) 



List all Python Programs