Program to Copy and Append List Python || List || Python

In this we are going to see a basic program to Copy and Append List in Python Programming Language.

list1 = ["Apple", "Banana", "Orange", "Grapes", "Mango"]
list2 = list(list1)
print("List 1 : ", list1)
print("List 2 : ", list2)
# Appending Elements And Printing Both Lists
print("---------------------------------------------------------------")
# Appending Element in the end
list1.append("Cherry")
# Appending Element in the front
list2.insert(0, "Pineapple")
print("List 1 : ", list1)
print("List 2 : ", list2)

# Coded By DHIRAJ SHELKE

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post