Skip to content

Instantly share code, notes, and snippets.

@sumon328
Created August 21, 2020 16:12
Show Gist options
  • Save sumon328/323e7ee251d837cc2e0e30cc507d8bff to your computer and use it in GitHub Desktop.
Save sumon328/323e7ee251d837cc2e0e30cc507d8bff to your computer and use it in GitHub Desktop.
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