How to start:

  1. Take two list from from the user.
  2. Then , merge two list and show the result.

Source code:


a=[]
c=[]
n1=int(input("Enter number of elements:"))
for i in range(1,n1+1):
b=int(input("Enter element:"))
a.append(b)
n2=int(input("Enter number of elements:"))
for i in range(1,n2+1):
d=int(input("Enter element:"))
c.append(d)
n=a+c
new.sort()
print("Sorted list is:",n)

Output:

Explanation:

  1. User input number of element and element for two list .
  2. Program add two list and print result.

Leave a Reply

Your email address will not be published. Required fields are marked *