Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
In this for loop, the variable “i” is assigned to the first value in the range, this is then printed in the
second line. Next, the “i” variable picks up the second value which is then printed. This process is
repeated until the end of the range. This would altogether produce:
In this loop, “var_x” starts as zero, which is less than 100. So the next line is executed and the print
statement is called. The next line adds 1 to “var_x”. As this is the end of the loop, x is once again
checked to see if it is less than 100. This cycle is then continued until var_x = 99. This would
altogether produce:
In this loop variable values, text and a calculation are concentrated (joined) in one line. The text
(strings are contained between the quotes in green. The commas are used to concentrate the
different elements of code. In the print statement the first “var_x” gives its value, and the “y*x”
does the calculation. This would altogether produce:
This is an array variable. Array variables are variables that contain other variable. If I printed this
array, it would look like this: