Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by zerotomastery.io #
 
PREVIOUS NEXT
Tagged: #python #list
ADD COMMENT
Topic
Name
3+4 =