Power ‘Ranges’

--Originally published at Nihilistic Kirby

Ranges are very easy to understand, you can use ranges to print the word “meow” for each int value you give, you can use it to repeat some function in order to make some kind of sum, you just need to THINK OUT OF THE BOX, the same as any other python tool, things can seem to be pretty simple, but even the simpler things can become complicated as hell and create wonderful thousands of lines of code.

For example, in this code (that I got  hell lot of help by Ken with), in which I tried to repeat a function, check it out:

for n in range(0,sd):
forces = force()
sum_forces[0] += forces[0]
sum_forces[1] += forces[1]

This loop works with a range “sd” that is defined as the number I want to repeat the process, and the variable assigned to the function “force()” makes it easier to execute, as every time the function generates values, they will be sum into a unique variable for each value or result (hope you can understand that).