Division always yelds a floating-point number, so the following doesn't work, you have to explicitly use floor():
min = time / 60
sec = time % 60
Also var x = [1, 2, 3]
x[1] /= 2
It's weird that now x includes one float and 2 integers. Besides, x[1] == 1 evaluates to false because a float never equals an integer.The description of 'for' loops is not complete. For example, does range(1, 10) go from 1 to 10 or from 1 to 9? What is the value of the iteration variable after exiting the loop?
The example to handle a variable number of arguments calls the function callee() with 0 to 4 arguments. So it IS possible to have functions with a variable number of parameters. What's the goal of this example, then?
You can disregard and ignore most floating to int conversions and checks if youre NOT targeting python. Other platforms generally have just double precision and no integers (incluiding the C and Java ones) but not happening in python.
In your example x[1] == 1 yields true in any platform. So dont worry.
The for loop will iterate exacly end - start times with a start of 0 if missing and finish after end - 1 has executed.
Using the iteration variable after loop exit is undefined behavior, some platforms keep the last value stored like python and javascript, others will make a wild assignment to a global variable every time like lua or the C/Java editions.
Functions do NOT have variable lenght calls, if you read the code a second time, what its doing is looking up an array based in arguments length, and proceeding to switch on each case.
Hope this helped, will update the handbook if something is unclear.
- Shogun
-Shogun