In: Computer Science
In DrRacket
Write a function, removeAll, which takes two lists, list-a and list-b and returns a list containing only the items in list-a that are not also in list-b. E.g., (remove-all '(a b b c c d) '(a c a)) -> '(b b d)
PYTHON CODING:-
OUTPUT:-
1.
Enter the no of items in the first list:6
Enter the items of the first list:
a
b
b
c
c
d
Enter the no of items in the second list:3
Enter the items in the second list:
a
c
a
The first input list:
['a', 'b', 'b', 'c', 'c', 'd']
The second input list:
['a', 'c', 'a']
The output list:
['b', 'b', 'd']
2.
Enter the no of items in the first list:4
Enter the items of the first list:
book
pen
mobile
scale
Enter the no of items in the second list:3
Enter the items in the second list:
book
pen
watch
The first input list:
['book', 'pen', 'mobile', 'scale']
The second input list:
['book', 'pen ', 'watch']
The output list:
['pen', 'mobile', 'scale']