@@ -42,6 +42,7 @@ msgstr ""
42
42
"Forse il tipo di istruzione più conosciuto è l'istruzione :keyword:`if`. "
43
43
"Ad esempio::"
44
44
45
+
45
46
#: tutorial/controlflow.rst:33
46
47
msgid ""
47
48
"There can be zero or more :keyword:`elif` parts, and the :keyword:`else` "
@@ -50,17 +51,25 @@ msgid ""
50
51
"keyword:`!elif` ... :keyword:`!elif` ... sequence is a substitute for the "
51
52
"``switch`` or ``case`` statements found in other languages."
52
53
msgstr ""
54
+ "Possiamo avere zero o più parti :keyword:`elif`, e la parte :keyword:`else` "
55
+ "è facoltativa. La parola chiave ':keyword:`!elif`' è l'abbreviazione di 'else if', "
56
+ "ed è utile per evitare un'eccessiva indentazione. Una sequenza :keyword:`!if` ... :"
57
+ "keyword:`!elif` ... :keyword:`!elif` ... è un sostituto per le istruzioni "
58
+ "``switch`` o ``case`` trovate in altri linguaggi."
53
59
54
60
#: tutorial/controlflow.rst:39
55
61
msgid ""
56
62
"If you're comparing the same value to several constants, or checking for "
57
63
"specific types or attributes, you may also find the :keyword:`!match` "
58
64
"statement useful. For more details see :ref:`tut-match`."
59
65
msgstr ""
66
+ "Se stai confrontando lo stesso valore con diverse costanti, o controllando "
67
+ "tipi o attributi specifici, potresti trovare utile l'istruzione :keyword:`!match`. "
68
+ "Per maggiori dettagli, consulta :ref:`tut-match`."
60
69
61
70
#: tutorial/controlflow.rst:46
62
71
msgid ":keyword:`!for` Statements"
63
- msgstr ""
72
+ msgstr "Istruzioni :keyword:`!for` "
64
73
65
74
#: tutorial/controlflow.rst:51
66
75
msgid ""
@@ -72,23 +81,35 @@ msgid ""
72
81
"a string), in the order that they appear in the sequence. For example (no "
73
82
"pun intended):"
74
83
msgstr ""
84
+ "L'istruzione :keyword:`for` in Python differisce leggermente da ciò a cui potresti essere "
85
+ "abitualmente abituato in C o Pascal. Piuttosto che iterare sempre su una "
86
+ "progressione aritmetica di numeri (come in Pascal), o dare all'utente la possibilità di "
87
+ "definire sia il passo di iterazione che la condizione di arresto (come in C), l'istruzione "
88
+ ":keyword:`!for` di Python itera sugli elementi di qualsiasi sequenza (una lista o "
89
+ "una stringa), nell'ordine in cui appaiono nella sequenza. Ad esempio:"
75
90
76
91
#: tutorial/controlflow.rst:72
77
92
msgid ""
78
93
"Code that modifies a collection while iterating over that same collection "
79
94
"can be tricky to get right. Instead, it is usually more straight-forward to "
80
95
"loop over a copy of the collection or to create a new collection::"
81
96
msgstr ""
97
+ "Il codice che modifica una collezione durante l'iterazione sulla stessa "
98
+ "può essere difficile da scrivere correttamente. Invece, è "
99
+ "generalmente più semplice iterare su una copia della collezione o crearne "
100
+ "una nuova:"
82
101
83
102
#: tutorial/controlflow.rst:94
84
103
msgid "The :func:`range` Function"
85
- msgstr ""
104
+ msgstr "La Funzione :func:`range` "
86
105
87
106
#: tutorial/controlflow.rst:96
88
107
msgid ""
89
108
"If you do need to iterate over a sequence of numbers, the built-in function :"
90
109
"func:`range` comes in handy. It generates arithmetic progressions::"
91
110
msgstr ""
111
+ "Se hai bisogno di iterare su una sequenza di numeri, la funzione integrata :"
112
+ "func:`range` è utile. Genera progressioni aritmetiche::"
92
113
93
114
#: tutorial/controlflow.rst:108
94
115
msgid ""
@@ -97,22 +118,32 @@ msgid ""
97
118
"10. It is possible to let the range start at another number, or to specify "
98
119
"a different increment (even negative; sometimes this is called the 'step')::"
99
120
msgstr ""
121
+ "Il valore finale fornito non fa parte della sequenza generata; ``range(10)`` "
122
+ "genera 10 valori, gli indici legali per gli elementi di una sequenza di "
123
+ "lunghezza 10. È possibile far partire l'intervallo da un altro numero, o "
124
+ "specificare un incremento diverso (anche negativo; talvolta questo è "
125
+ "chiamato 'passo')::"
100
126
101
127
#: tutorial/controlflow.rst:122
102
128
msgid ""
103
129
"To iterate over the indices of a sequence, you can combine :func:`range` "
104
130
"and :func:`len` as follows::"
105
131
msgstr ""
132
+ "Per iterare sugli indici di una sequenza, puoi combinare :func:`range` "
133
+ "e :func:`len` nel seguente modo::"
106
134
107
135
#: tutorial/controlflow.rst:135
108
136
msgid ""
109
137
"In most such cases, however, it is convenient to use the :func:`enumerate` "
110
138
"function, see :ref:`tut-loopidioms`."
111
139
msgstr ""
140
+ "Nella maggior parte di questi casi, però, è conveniente utilizzare la funzione :func:`enumerate`, "
141
+ "vedi :ref:`tut-loopidioms`."
112
142
113
143
#: tutorial/controlflow.rst:138
114
144
msgid "A strange thing happens if you just print a range::"
115
145
msgstr ""
146
+ "Attenzione: succede una cosa strana se provi a stampare un range::"
116
147
117
148
#: tutorial/controlflow.rst:143
118
149
msgid ""
@@ -121,6 +152,10 @@ msgid ""
121
152
"items of the desired sequence when you iterate over it, but it doesn't "
122
153
"really make the list, thus saving space."
123
154
msgstr ""
155
+ "In molti casi, l'oggetto restituito da :func:`range` si comporta come se fosse una "
156
+ "lista, ma in realtà non lo è. È un oggetto che restituisce gli elementi successivi "
157
+ "della sequenza desiderata quando ci si itera sopra, ma non crea effettivamente "
158
+ "la lista, risparmiando così spazio."
124
159
125
160
#: tutorial/controlflow.rst:148
126
161
msgid ""
@@ -130,31 +165,43 @@ msgid ""
130
165
"keyword:`for` statement is such a construct, while an example of a function "
131
166
"that takes an iterable is :func:`sum`::"
132
167
msgstr ""
168
+ "Diciamo che un tale oggetto è un :term:`iterable`, cioè adatto per "
169
+ "funzioni e costrutti che si aspettano qualcosa da cui possono ottenere "
170
+ "elementi fino a quando il contenitore è vuoto. Abbiamo visto che "
171
+ "l'istruzione :keyword:`for` è un tale costrutto, mentre un esempio di una funzione "
172
+ "che prende come argomento un oggetto iterabile è :func:`sum`::"
133
173
134
174
#: tutorial/controlflow.rst:157
135
175
msgid ""
136
176
"Later we will see more functions that return iterables and take iterables as "
137
177
"arguments. In chapter :ref:`tut-structures`, we will discuss in more detail "
138
178
"about :func:`list`."
139
179
msgstr ""
180
+ "In seguito vedremo altre funzioni che restituiscono oggetti iterabili e prendono oggetti iterabili come "
181
+ "argomenti. Nel capitolo :ref:`tut-structures`, discuteremo in modo più dettagliato "
182
+ "riguardo a :func:`list`."
140
183
141
184
#: tutorial/controlflow.rst:164
142
185
msgid ""
143
186
":keyword:`!break` and :keyword:`!continue` Statements, and :keyword:`!else` "
144
187
"Clauses on Loops"
145
188
msgstr ""
189
+ "Istruzioni :keyword:`!break` e :keyword:`!continue`, e clausole :keyword:`!else` "
190
+ "nei cicli"
146
191
147
192
#: tutorial/controlflow.rst:166
148
193
msgid ""
149
194
"The :keyword:`break` statement breaks out of the innermost enclosing :"
150
195
"keyword:`for` or :keyword:`while` loop."
151
196
msgstr ""
197
+ "L'istruzione :keyword:`break` esce dal ciclo :keyword:`for` o :keyword:`while` più interno."
152
198
153
199
#: tutorial/controlflow.rst:169
154
200
msgid ""
155
201
"A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` "
156
202
"clause."
157
203
msgstr ""
204
+ "Un ciclo :keyword:`!for` o :keyword:`!while` può includere una clausola :keyword:`!else`."
158
205
159
206
#: tutorial/controlflow.rst:171
160
207
msgid ""
0 commit comments