|
101.
|
|
|
functions!sum
|
|
|
type: index{#1}
|
|
|
|
functions!sum
|
|
Translated and reviewed by
Martino Barbon
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:432
|
|
102.
|
|
|
The \textbf{sum} function adds up items in a list and returns the total number. For example:
|
|
|
type: Plain text
|
|
|
|
La funzione \textbf{sum} somma i numeri in una lista e restituisce il totale. Per esempio:
|
|
Translated and reviewed by
Martino Barbon
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:434
|
|
103.
|
|
|
>>> mylist = list(range(0, 500, 50)) ![](/@@/translation-newline)
>>> print(mylist) ![](/@@/translation-newline)
[0, 50, 100, 150, 200, 250, 300, 350, 400, 450]
|
|
|
type: verbatim
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
>>> mialista = list(range(0, 500, 50)) ![](/@@/translation-newline)
>>> print(mialista) ![](/@@/translation-newline)
[0, 50, 100, 150, 200, 250, 300, 350, 400, 450]
|
|
Translated and reviewed by
Martino Barbon
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:440
|
|
104.
|
|
|
>>> print(sum(mylist)) ![](/@@/translation-newline)
2250
|
|
|
type: verbatim
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
>>> print(sum(mialista)) ![](/@@/translation-newline)
2250
|
|
Translated and reviewed by
Martino Barbon
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:443
|