Skip to content

Instantly share code, notes, and snippets.

View vikingviolinist's full-sized avatar
🎻

Michal Petrik vikingviolinist

🎻
View GitHub Profile
@vikingviolinist
vikingviolinist / random_lists.py
Created December 9, 2017 16:38
Randomly generate two lists and write a program that returns a list that contains only the elements that are common between the lists (without duplicates).
import random
x = random.sample(range(1, 100), 10)
y = random.sample(range(1, 100), 13)
print(x)
print(y)
print([i for i in set(x) if i in set(y)])