list in python
myfavouritefoods = ["Pizza", "burgers" , "chocolate"]
print(myfavouritefoods[1])
#or
print(myfavouritefoods)
list in python
myfavouritefoods = ["Pizza", "burgers" , "chocolate"]
print(myfavouritefoods[1])
#or
print(myfavouritefoods)
list in python
thislist = ["apple", "banana", "cherry"]
print(thislist[1])
list in python
myList = ["Test", 419]
myList.append(10)
myList.append("my code")
print(myList)
list in python
# Python program to demonstrate
# Removal of elements in a List
# Creating a List
List = [1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12]
print("Intial List: ")
print(List)
# Removing elements from List
# using Remove() method
List.remove(5)
List.remove(6)
print("nList after Removal of two elements: ")
print(List)
# Removing elements from List
# using iterator method
for i in range(1, 5):
List.remove(i)
print("nList after Removing a range of elements: ")
print(List)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us