Nauč se Python > Kurzy > Beginners course PyLadies > Functions > Turtle and loops

Turtle and loops – Řešení [4]

The command sum = sum + number calculates the value of sum + number, adds the current number to the sum, and stores the result in the variable sum. The new value of sum will be used in the next loop.

In the beginning the sum is 0, and in the end the sum of our numbers will be printed.


Toto je stránka lekce z kurzu, který probíhá nebo proběhl naživo s instruktorem.