Screen Link: Learn data science with Python and R projects
My Code:
row_1 = [‘Facebook’, 0.0, ‘USD’, 2974676, 3.5]
row_2 = [‘Instagram’, 0.0, ‘USD’, 2161558, 4.5]
row_3 = [‘Clash of Clans’, 0.0, ‘USD’, 2130805, 4.5]
row_4 = [‘Temple Run’, 0.0, ‘USD’, 1724546, 4.5]
row_5 = [‘Pandora - Music & Radio’, 0.0, ‘USD’, 1126879, 4.0]
first_4_fb = row_1[:4]
last_3_fb = row_1[-3:]
pandora_3_4 = row_5[2:4]
print(first_4_fb)
print(last_3_fb)
print(pandora_3_4)
output:
[‘Facebook’, 0.0, ‘USD’, 2974676]
[‘USD’, 2974676, 3.5]
[‘USD’, 1126879]
under the line 7 how as list slicing syntax shortcut “pandora_3_4 = row_5[2:4]” here 2:4 came! Ive already understood about the meaning 2 but not 4