|
16.
|
|
|
>>> print(cmp(1,2)) ![](/@@/translation-newline)
-1
|
|
|
type: verbatim
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
>>> print(cmp(1,2)) ![](/@@/translation-newline)
-1
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:60
|
|
17.
|
|
|
And 2 is equal to 2:
|
|
|
type: Plain text
|
|
|
|
Mentre 2 è uguale a 2:
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:65
|
|
18.
|
|
|
>>> print(cmp(2,2)) ![](/@@/translation-newline)
0
|
|
|
type: verbatim
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
>>> print(cmp(2,2)) ![](/@@/translation-newline)
0
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:70
|
|
19.
|
|
|
But 2 is greater than 1:
|
|
|
type: Plain text
|
|
|
|
Ma 2 è più grande di 1:
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:75
|
|
20.
|
|
|
>>> print(cmp(2,1)) ![](/@@/translation-newline)
1
|
|
|
type: verbatim
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
>>> print(cmp(2,1)) ![](/@@/translation-newline)
1
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:80
|
|
21.
|
|
|
Compare doesn't only work with numbers. You can use other values, such as strings:
|
|
|
type: Plain text
|
|
|
|
La funzione per comparare non funziona soltanto con i numeri. Puoi utilizzare altri valori, come per esempio le stringhe:
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:85
|
|
22.
|
|
|
>>> print(cmp('a','b')) ![](/@@/translation-newline)
-1 ![](/@@/translation-newline)
>>> print(cmp('a','a')) ![](/@@/translation-newline)
0 ![](/@@/translation-newline)
>>> print(cmp('b','a')) ![](/@@/translation-newline)
1
|
|
|
type: verbatim
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
>>> print(cmp('a','b')) ![](/@@/translation-newline)
-1 ![](/@@/translation-newline)
>>> print(cmp('a','a')) ![](/@@/translation-newline)
0 ![](/@@/translation-newline)
>>> print(cmp('b','a')) ![](/@@/translation-newline)
1
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:94
|
|
23.
|
|
|
But do be careful with strings; the return value may not be exactly what you expect$\ldots$
|
|
|
type: Plain text
|
|
|
|
Ma stai molto attento con le stringhe; il valore restituito potrebbe non essere esattamente quello che ti aspetti$\ldots$
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:99
|
|
24.
|
|
|
>>> print(cmp('a','A')) ![](/@@/translation-newline)
1 ![](/@@/translation-newline)
>>> print(cmp('A','a')) ![](/@@/translation-newline)
-1
|
|
|
type: verbatim
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
>>> print(cmp('a','A')) ![](/@@/translation-newline)
1 ![](/@@/translation-newline)
>>> print(cmp('A','a')) ![](/@@/translation-newline)
-1
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:106
|
|
25.
|
|
|
A lower-case 'a' is actually greater than an upper-case 'A'. Of course$\ldots$
|
|
|
type: Plain text
|
|
|
|
Una 'a' minuscola in realtà è più grande di una 'A'. Naturalmente$\ldots$
|
|
Translated and reviewed by
Emanuele Rampichini
|
|
|
|
Located in
./ORIGINAL/appendixb.tex:110
|