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 »

Insert items in python list by using append() function

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

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

Insert a new item in python list

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

Insert a new item in python list Read More »

Replace the list value in python list by using range index

View All Python Programs Source Code thislist = [“keyboard”, “mouse”, “light pen”, “joystick”, “scanner”] print(“Old List”) print(thislist) thislist[1:3] = [“monitor”, “mobile”] print(“Updated List”) print(thislist) Output Old List [‘keyboard’, ‘mouse’, ‘light pen’, ‘joystick’, ‘scanner’] Updated List [‘keyboard’, ‘monitor’, ‘mobile’, ‘joystick’, ‘scanner’] View All Python Programs

Replace the list value in python list by using range index Read More »

Replace the list value in python list form new value

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

Replace the list value in python list form new value Read More »

Find the item in python list, is exit or not

View All Python Programs Source Code thislist = [“apple”, “banana”, “cherry”, “orange”, “kiwi”, “melon”, “mango”] item=input(“Enter the item for search : “) if item in thislist:     print(“Item is found”) else:     print(“Item does not exist in list”) Output Enter the item for search : melon Item is found View All Python Programs

Find the item in python list, is exit or not Read More »