Created
April 29, 2020 22:57
-
-
Save Raj39120/0dee52469f00b58aff5eb48968cdd864 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
import random | |
from random import randrange | |
a = [] | |
for i in range(0, randrange(1, 20)): | |
n = random.randint(1, 100) | |
a.append(n) | |
b = [] | |
for i in range(0, randrange(1, 20)): | |
n = random.randint(1, 100) | |
b.append(n) | |
print(a) | |
print(b) | |
my_list = [] | |
for i in a and b: | |
if i in a and b: | |
my_list.append(i) | |
if i in my_list: | |
break | |
if i not in a and b: | |
pass | |
print my_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment