Мой профиль
ACTIVITY 27 / 50

Part of a list

Try as many times as you need

Let’s understand

A slice items[start:stop] returns part of a list. The start is included; the end is excluded. items[:2] takes the first two items. Reading a slice does not change the original list.

Listen to the explanation

Example

print([2, 4, 6, 8][1:3])
YOUR MISSION

Print the first two values of readings using a slice.

I need a hint

The slice [:2] stops before index 2.

How to find an error
  1. Read the last line of the error message.
  2. Find the indicated line. Check quotes, parentheses and indentation.
  3. Change one thing and run again.

main.py

4 spaces

Your draft stays in this browser.

Result

Python
Your program’s output will appear here. Click Run.