Answers for "how to creat a list in python"

6

how to create a list in python

#creating a list
create_list = ["apple", "banana", "cherry"]
print(create_list)
Posted by: Guest on September-30-2020
12

python lists

thislist = ["apple", "banana", "cherry"]
print(thislist[1])
Posted by: Guest on January-07-2020
6

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
Posted by: Guest on May-21-2020

Code answers related to "how to creat a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language