What is the difference between slice and range? | Sololearn: Learn to code for FREE!

+2

What is the difference between slice and range?

7/12/2021 5:49:48 AM

Pranjal Rastogi

2 Answers

New Answer

+4

The most common difference is, the range is iterable and the slice is not iterable. You can have a look at this article: https://til.hashrocket.com/posts/5zuzolqlcb-range-v-slice

+2

Need to specify whether you are talking about A. the built-in function slice() or B. using slice notation