list in python
fruits = ["apple", "banana", "cherry"]
print(fruits)
fruits[0]
fruits[:2]
list in python
fruits = ["apple", "banana", "cherry"]
print(fruits)
fruits[0]
fruits[:2]
python list
#Creating lists
my_list = [1, "Hello", 3.4, 0, "World"]
my_nested_list = [['Hello', 'World'],[47,39]]
#Accessing lists
my_list[1] # Hello
my_list[-2] # 0
my_list[:3] # [1, "Hello", 3.4]
my_nested_list[1] #[47,39]
my_nested_list[0][1] # World
list in python
list = [0,1,2,3,4]
print("printing original list: ");
for i in list:
print(i,end=" ")
list.remove(2)
print("nprinting the list after the removal of first element...")
for i in list:
print(i,end=" ")
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