Ranges in python

--Originally published at Hector Martinez Alcantara

A range is a list of elements from one point to another.

The sintaxis is:

range(condition)

You can do a range to be from some number to another, and with some condition

Examples:

var=range(9) #Result:0,1,2,3,4,5,6,7,8
var=range(3,7) #Result:3,4,5,6
var=range(0,100,10) #Result:0,10,20,30,40,50,60,70,80,90

In the first example the range begins in 0 and finishes in 8 returning a list from 0 to 8.

In the second example the first number represents the first number of the range, and the second number the finish, but always the number of finish will be one less than the specified.

In the third example, is the same as the second, the first number indicate the beginning and the second number indicates the finish, but the third number indicates how many numbers separate one number from another.

Thanks for reading, comment.