<?xml version="1.0" encoding="UTF-8"?>

<upm-export>
	<title>Enseignement de l&#039;informatique et du numérique au lycée Boissy d&#039;Anglas</title>
	<link>https://icn-isn-boissy.yj.fr/wp</link>
	<description></description>
	<pubDate>Tue Jun 23 14:48:28 2026 / +0000  GMT</pubDate>
	<generator>Universal Post Manager 1.1.2 [ www.ProfProjects.com ] </generator>
	<language></language>
	
			<item>
			<title>4- La boucle while</title>
			<link>https://icn-isn-boissy.yj.fr/wp/?p=1743</link>
			<pubDate>Tue Jun 23 14:48:28 2026 / +0000  GMT</pubDate>
			<guid isPermaLink="false">https://icn-isn-boissy.yj.fr/wp/?p=1743</guid>
			<content-encoded><![CDATA[<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">La boucle while</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>
				La notion de boucle est fondamentale en informatique. Une boucle 
permet d'exécuter plusieurs fois des instructions qui ne sont présentes 
qu'une seule fois dans le code.
			</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>La structure de la boucle while est la suivante :</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>while expression:
	instruction1
	instruction2
suite programme			</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>Tant que l'expression s'évalue à "True", les instructions à l'intérieur du bloc (partie indentée) seront exécutées.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">À faire vous-même 25</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Soit le programme suivant :</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>i = 0
while i &lt; 10:
	print(f"i vaut : {i}")
	i = i + 1
print("C'est terminé.")			</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>Quel est le résultat attendu après l'exécution de ce programme ?
				Vérifiez votre réponse en testant le programme</p>
<!-- /wp:paragraph -->

<!-- wp:separator {"opacity":"css"} -->
<hr class="wp-block-separator has-css-opacity"/>
<!-- /wp:separator -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">À faire vous-même 26</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Écrire une fonction qui prendra 2 paramètres : une chaîne de caractère et un nombre entier</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
				 permettant de créer "un générateur automatique de punition" :
			</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Par exemple :</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Si on passe comme paramètres à notre fonction : "Je ne dois pas discuter en classe" et 3</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>La fonction devra permettre d'afficher :</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Je ne dois pas discuter en classe</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Je ne dois pas discuter en classe</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Je ne dois pas discuter en classe</p>
<!-- /wp:paragraph -->

<!-- wp:separator {"opacity":"css"} -->
<hr class="wp-block-separator has-css-opacity"/>
<!-- /wp:separator -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">À faire vous-même 27</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>
				Écrire une fonction permettant d'afficher une table de multiplication.
				Cette fonction devra prendre en paramètre la table désirée.
			</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
				Par exemple si l'on passe le paramètre 3 à la fonction, la fonction devra permettre d'afficher :
			</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>1 x 3 = 3</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>2 x 3 = 6</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>...</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>...</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>10 x 3 = 30</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<figure class="wp-block-image is-resized"><a href="https://icn-isn-boissy.yj.fr/wp/2019/09/04/les-bases-de-python-2-les-fonctions/"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2019/08/Suite.jpg" alt="" class="wp-image-1772" width="125" height="98"/><figcaption>Suite :  <strong>Les fonctions</strong></a> </figcaption></figure>
<!-- /wp:html -->

<!-- wp:embed {"url":"https://www.youtube.com/watch?v=5l7gIfDJxkg","type":"video","providerNameSlug":"youtube","responsive":true,"className":"wp-embed-aspect-16-9 wp-has-aspect-ratio"} -->
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<p style="clear:both"> YouTube Video: <a href="http://www.youtube.com/watch?v=5l7gIfDJxkg">YouTube.com/watch?v=5l7gIfDJxkg</a> </p>
</div></figure>
<!-- /wp:embed -->]]></content-encoded>
			<excerpt-encoded><![CDATA[]]></excerpt-encoded>
			<wp-post_id>1743</wp-post_id>
			<wp-post_date>2019-09-04 17:19:45</wp-post_date>
			<wp-post_date_gmt>2019-09-04 15:19:45</wp-post_date_gmt>
				</item>
</upm-export>
