Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Displaying values
Variables
The print function
List basics
19. Accessing multiple list elements – part 2
Summary

Instruction

Excellent. When we wrote canadian_cities[0:3], we explicitly specified the first and the last element we wanted. When one of those values denotes the first or last element in the list, we can skip it:

# all elements from the very beginning to canadian_cities[2]
canadian_cities[:3]

#all elements from canadian_cities[3] to the very end 
canadian_cities[3:]

Exercise

Show all daily sales except for the first two days.

Stuck? Here's a hint!

Use daily_sales[2:] to filter out elements with indices [0] and [1].