Lesson 5.2
A slice takes part of a list, just like with a string: the right bound is not included.
games = ["Minecraft", "Roblox", "Brawl Stars", "Among Us"]
print(games[:2]) # the first two
print(games[-2:]) # the last two
print(games[1:3]) # from 1 to 2 inclusive
The result of a slice is a new list, not a piece of the old one.
The list items and the bounds start and stop are set by the check. Print, in order:
stop items;stop items;start to stop inclusive.A piece of a list is set in brackets with a colon: [start:end] — for example,
items[:stop] and items[start:stop + 1].
You need three slices of the same variable: from the start to stop, from -stop to
the end, and from start to stop inclusive — the last one needs stop + 1.