Python List Slicing Quiz

This Python slicing quiz tests start:stop:step with positive and negative numbers, reversed lists and slice assignment. It is for learners who know indexing and want slices to stop being guesswork.

Medium 10 questions ~6 minutes Pass at 80% Python 3.12

Choose a mode

Playing as a guest: sign in to keep your XP and streak.

Sample question

Question 1 of 10

What does this print?

nums = [0, 1, 2, 3, 4, 5]
print(nums[1:4])
Show the answer

A. [1, 2, 3] A slice starts at the first index and stops before the second one. So 1:4 gives the items at indexes 1, 2 and 3.

What this quiz covers

  • Why the stop index is not included
  • Negative indexes and negative steps
  • Slices that go past the end of the list
  • Slices as copies
  • Replacing part of a list with slice assignment

Questions people ask

Do I need an account?

No. Anyone can play. Sign in to keep your XP, streak, badges and history.

Which Python version?

Python 3.12. Every question about output was checked by running the code.

Can I retake it?

Yes. Your best score is kept, and the questions and answers are shuffled each time.