--Originally published at Ed_Alita
Don’t be scared by the word there are easy as pie
Let’s see that you want to print all number between 1 and 5; therefore you need a range. But let me tall you a little secret in range it only takes until the number you tell it but do not take the actual number in consideration. Let’s see an example:
In this the 5 willnot be printed.
The actual result of this code is the next one:
Now lets see a more complex range with two variables:
in this case the result will be:
If you want to see more info in the next link:
http://pythoncentral.io/pythons-range-function-explained/