Created
August 21, 2020 16:12
-
-
Save sumon328/323e7ee251d837cc2e0e30cc507d8bff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("\n___________Welcome to List Overlap Comprehensions Solutions #Exercise 10 ___________") | |
import random | |
a = [random.randrange(1, 10) for _ in range(0, random.randint(1,20))] | |
b = [random.randrange(1, 10) for _ in range(0, random.randint(1,20))] | |
c = [] | |
c = [a[i] for i in range(0, len(a)) if (a[i] not in c and a[i] in b)] | |
print(a) | |
print(b) | |
print(c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment