<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>yk non viene mai azzerato<br>
</p>
<div class="moz-cite-prefix">Il 15/02/22 14:04, Gabriele Battaglia
ha scritto:<br>
</div>
<blockquote type="cite"
cite="mid:2542b957-b268-6fa0-02e0-063d3698546f@libero.it">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p>Questo semplice script con 2 while annidati:</p>
<p><br>
</p>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;"><div><span style="color: #6a9955;">#testwhile</span></div><div><span style="color: #9cdcfe;">yi</span><span style="color: #d4d4d4;">,</span><span style="color: #9cdcfe;">yk</span><span style="color: #d4d4d4;">=</span><span style="color: #b5cea8;">0</span><span style="color: #d4d4d4;">,</span><span style="color: #b5cea8;">0</span></div><div><span style="color: #c586c0;">while</span><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">yi</span><span style="color: #d4d4d4;"><</span><span style="color: #b5cea8;">2</span><span style="color: #d4d4d4;">:</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #c586c0;">while</span><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">yk</span><span style="color: #d4d4d4;"><</span><span style="color: #b5cea8;">5</span><span style="color: #d4d4d4;">:</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #dcdcaa;">print</span><span style="color: #d4d4d4;">(</span><span style="color: #9cdcfe;">yi</span><span style="color: #d4d4d4;">,</span><span style="color: #9cdcfe;">yk</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">yk</span><span style="color: #d4d4d4;">+=</span><span style="color: #b5cea8;">1</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">yi</span><span style="color: #d4d4d4;">+=</span><span style="color: #b5cea8;">1</span></div><div><span style="color: #b5cea8;">
</span></div><div><span style="color: #b5cea8;">output:</span></div><div><span style="color: #b5cea8;">e:\Dropbox\py>testwhile
0 0
0 1
0 2
0 3
0 4
e:\Dropbox\py>
</span></div><div><span style="color: #b5cea8;">
</span></div><div><span style="color: #b5cea8;">Ma sogno o son desktop?</span></div><div><span style="color: #b5cea8;">Perchè la yi non diventa 1 e fa ripetere una seconda volta, il ciclo più interno?</span></div><div><span style="color: #b5cea8;">
</span></div><div><span style="color: #b5cea8;">Gabry.
</span></div></div>
<pre class="moz-signature" cols="72">--
--... ...-- -.. . .. --.. ....- .- .--. ..- - ..- . .
Sent from TB on Windows 10, Genus Bononiae's computer.</pre>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python@lists.python.it">Python@lists.python.it</a>
<a class="moz-txt-link-freetext" href="https://lists.python.it/mailman/listinfo/python">https://lists.python.it/mailman/listinfo/python</a>
</pre>
</blockquote>
</body>
</html>