Skip to content

Commit 1b7e98f

Browse files
committed
Union of Lists
1 parent 48d0537 commit 1b7e98f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

union_of_lists.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
__author__ = 'Avinash'
2+
3+
lst = []
4+
num = int(input("Enter size of list 1: \t"))
5+
for n in range(num):
6+
numbers = int(input("Enter any number: \t"))
7+
lst.append(numbers)
8+
9+
lst2 = []
10+
num2 = int(input("Enter size of list 2: \t"))
11+
for n in range(num2):
12+
numbers2 = int(input("Enter any number: \t"))
13+
lst2.append(numbers2)
14+
15+
union = list(set().union(lst, lst2))
16+
print("\nThe Union of two lists is \t", union)

0 commit comments

Comments
 (0)