Articles → Python → Insert and remove function in list in python

Insert and remove function in list in python






Index in list




Picture showing the graphical representation of index in list

Click to Enlarge


Insert function




list1 = ["Apple", "Banana"]
list1.insert(0,"Orange")
print(list1)




Picture showing the output of the Insert function of list in python

Click to Enlarge


Remove function




list1 = ["Apple", "Banana"]

list1.remove("Apple")
print(list1)




Picture showing the output of the Remove function of list in python

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, May 7, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250