Introduction to Python
Hugo Bowne-Anderson
Data Scientist at DataCamp
fam = ["liz", 1.73, "emma", 1.68, "mom", 1.71, "dad", 1.89]
fam
['liz', 1.73, 'emma', 1.68, 'mom', 1.71, 'dad', 1.89]
fam[3]
1.68
['liz', 1.73, 'emma', 1.68, 'mom', 1.71, 'dad', 1.89]
fam[6]
'dad'
fam[-1]
1.89
fam[7]
1.89
['liz', 1.73, 'emma', 1.68, 'mom', 1.71, 'dad', 1.89]
fam[6]
'dad'
fam[-1] # <-
1.89
fam[7] # <-
1.89
fam
['liz', 1.73, 'emma', 1.68, 'mom', 1.71, 'dad', 1.89]
fam[3:5]
[1.68, 'mom']
fam[1:4]
[1.73, 'emma', 1.68]
fam
['liz', 1.73, 'emma', 1.68, 'mom', 1.71, 'dad', 1.89]
fam[:4]
['liz', 1.73, 'emma', 1.68]
fam[5:]
[1.71, 'dad', 1.89]
Introduction to Python