Explore Connect Documentation
Snippets

Computing with Data

elgeish
181.6K views
GitHub

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content
Previous: Lists Next: Slicing

Ranges

The built-in function range is often used to access a list of evenly-spaced integers:

1
2
3
4
print(list(range(0, 10, 1)))
print(tuple(range(0, 10))) # same as tuple(range(0, 10, 1))
print(tuple(range(10))) # same as tuple(range(0, 10))
print(tuple(range(0, 10, 2))) # step size of 2
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Suggested playgrounds

Recueil d'exercices pour apprendre Python au lycée

By
M_C
300.9K
156
44

How to build a chatbot in less than 50 lines of code

By
[CG]Maxime
15.6K
74
4

Longest substring in Python

By
tsv
6,211
11
2

Java Interview Questions and Programming Examples

By
[CG]OlogN
72.5K
45
12
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content