brcinstitute111@gmail.com

Remove specific items in python list by using del keyword function

View All Python Programs Source Code list1 = [“keyboard”, “mouse”,”jyostic”] print(“Old List”) print(list1) del list1[1] print(“Updated List”) print(list1) Output Old List [‘keyboard’, ‘mouse’, ‘jyostic’] Updated List [‘keyboard’, ‘jyostic’] View All Python Programs

Remove specific items in python list by using del keyword function Read More »

Remove specific items in python list by using pop() function

View All Python Programs Source Code list1 = [“keyboard”, “mouse”,” joystick”] print(“Old List”) print(list1) list1.pop(1) print(“Updated List”) print(list1) Output Old List [‘keyboard’, ‘mouse’, ‘joystick’] Updated List [‘keyboard’, ‘joystick’] View All Python Programs

Remove specific items in python list by using pop() function Read More »

Remove specific items in python list by using remove() function

View All Python Programs Source Code list1 = [“keyboard”, “mouse”, “joystick”] print(“Old List”) print(list1) list1.remove(“mouse”) print(“Updated List”) print(list1) Output Old List [‘keyboard’, ‘mouse’, ‘joystick’] Updated List [‘keyboard’, ‘joystick’] View All Python Programs

Remove specific items in python list by using remove() function Read More »

Insert items in python list by using extend() function

View All Python Programs Source Code list1 = [“keyboard”, “mouse”, “joystick”] list2 = [“camera”, “pencil”] print(“Old List”) print(list1) list1.extend(list2) print(“Updated List”) print(list1) Output Old List [‘keyboard’, ‘mouse’, ‘joystick’] Updated List [‘keyboard’, ‘mouse’, ‘joystick’, ‘camera’, ‘pencil’] View All Python Programs

Insert items in python list by using extend() function Read More »