KnowledgeBoat Logo

Computer Science

Write a Python program to append a list to the second list.

Python

Python List Manipulation

1 Like

Answer

list1 = eval(input("Enter the first list: "))
list2 = eval(input("Enter the second list: "))
list1.extend(list2)
print("Appended List:", list1)

Output

Enter the first list: [22, 44, 66, 88]
Enter the second list: [10, 30, 50, 70, 90]
Appended List: [22, 44, 66, 88, 10, 30, 50, 70, 90]

Answered By

1 Like


Related Questions