logo
How it worksCoursesResearch CommunitiesBenefitsAbout Us
Schedule Demo
Learn Before
  • Common Sequence Operations on Lists

Code

slicing with a step

  • The following example shows slicing of my_list with a step.
  • Syntax my_list opening square brackets i : j : k closing square brackets, i and j are the indexing integers and k is the step.
Image 0

0

1

Updated 2021-04-27

Contributors are:

Anju Manoj
Anju Manoj
🏆 5

Who are from:

San Jose State University
San Jose State University
🏆 5

References


  • Python Documentation

Tags

Python Programming Language

Data Science

Related
  • 'in' operator

  • 'not in' operator

  • '*' ( repetition ) operator

  • '+' ( concatenation ) operator

  • slicing the list from i to j ( i and j are integers )

  • indexing i th item of a list

  • slicing with a step

  • length of a list which is passed as the argument of the function len()

  • min() ( smallest item in the list )

  • max() ( largest item in the list )

  • index of an element in the list at or after an index and before another index

  • count ( total number of occurrences of a particular element in the list )

logo 1cademy1Cademy

Optimize Scalable Learning and Teaching

How it worksCoursesResearch CommunitiesBenefitsAbout Us
TermsPrivacyCookieGDPR

Contact Us

iman@honor.education

Follow Us




© 1Cademy 2026

We're committed to OpenSource on

Github