CBSE Class 11 Computer Science Question 89 of 104

List Manipulation — Question 3

Back to all questions
3
Question

Question 3

Write a program that inputs two lists and creates a third, that contains all elements of the first followed by all elements of the second.

Solution
l1 = eval(input("Enter first list: "))
l2 = eval(input("Enter second list: "))
l3 = l1 + l2
print("Joined List:", l3)
Output
Enter first list: [1, 2, 3, 4, 5]
Enter second list: [11, 12, 13, 14, 15] 
Joined List: [1, 2, 3, 4, 5, 11, 12, 13, 14, 15]
Answer