Monday, 24 January 2022

Write a Python program to accept two lists and merge the two lists into list of tuple.

Slip 28 Q 2

CODE :


list1 =[]
n=int(input('Enter number of elements in first list : '))
for i in range(n):
    value=int(input('enter {} value of list : '.format(i+1)))
    list1.append(value)

list2 =[]
n=int(input('Enter number of elements in second list : '))
for i in range(n):
    value=int(input('enter {} value of list : '.format(i+1)))
    list2.append(value)

print('list 1 : ',list1)
print('list 2 : ',list2)
tuple1=tuple(list1+list2)
print(tuple1)

OUTPUT:




No comments:

Post a Comment

Write a Java program to display given extension files from a specific directory on server machine.

 DOWNLOAD     SLIP14Q2 /** * STEPS TO RUN CODE * Step 01 compile the code * Step 02 run the code * Step 03 give a file directory locatio...