Skip to main content
Questions Why Us Pricing Log In Sign Up

Accessing a List via Slicing

How do you access elements of a list using slicing?

Answer

Syntax is [start:end:step].

[-1] last element, [:3] first three, [-3:] last three, [3:] from index 3 onward, [:] whole list, [::-1] reversed list.

← Back to collection
← Previous question Properties of a Set Next question Generator Expression vs List Comprehension 1 →

Social

  • Instagram

Contact

  • linkedin.com/in/rinorbirinxhiku/

Legal

  • Privacy Policy
  • Terms of Service
© 2026 quant.rb. All rights reserved.