brcinstitute111@gmail.com

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 »

Print the values form giving starting range to end range in python list

View All Python Programs Source Code end=int(input(“Enter the end range : “)) end=5 thislist = [“apple”, “banana”, “cherry”, “orange”, “kiwi”, “melon”, “mango”] print(thislist[:end]) Output Enter the end range : 4 [‘apple’, ‘banana’, ‘cherry’, ‘orange’, ‘kiwi’] View All Python Programs

Print the values form giving starting range to end range in python list Read More »

Print the values form start to giving end range in python list

View All Python Programs Source Code end=int(input(“Enter the end range : “)) end=5 thislist = [“apple”, “banana”, “cherry”, “orange”, “kiwi”, “melon”, “mango”] print(thislist[:end]) Output Enter the end range : 4 [‘apple’, ‘banana’, ‘cherry’, ‘orange’, ‘kiwi’] View All Python Programs

Print the values form start to giving end range in python list Read More »

Print the values of list by using list range index position in python

View All Python Programs Source Code strt=int(input(“Enter the starting range : “)) end=int(input(“Enter the end range : “)) end=5 thislist = [“apple”, “banana”, “cherry”, “orange”, “kiwi”, “melon”, “mango”] print(thislist[strt:end]) Output Enter the starting range : 1 Enter the end range : 4 [‘banana’, ‘cherry’, ‘orange’, ‘kiwi’] View All Python Programs

Print the values of list by using list range index position in python Read More »