so evidently you write for loops in python int he following:
for i in range(1, 5):
print i
but what if I’m actually using i as a counting trick and I specifically wanna do something like:
for (int i = 100; i > 20; i--)
or
for (int i = 0; i < 20 ; i += 2)
do you seriously have to write this in the body of the loop rather than the signature….
Different languages use different semantics to say the same thing. You can use the range function in several ways and it has as its arguments:
So I can do
to get a list like:
Using the three arguments of range you can get back to your counting tricks from C#, C++, C or Java.