Deutsch   English   Français   Italiano  
<st7sfb$14na$2@gioia.aioe.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.nobody.at!weretis.net!feeder8.news.weretis.net!usenet.goja.nl.eu.org!aioe.org!FdrTMw7+RJa5kGNwdwd/KQ.user.46.165.242.91.POSTED!not-for-mail
From: Dominique <zzz@aol.com.invalid>
Newsgroups: fr.comp.lang.python
Subject: Re: Sortir d 'une boucle while
Date: Mon, 31 Jan 2022 06:35:38 +0100
Organization: Aioe.org NNTP Server
Message-ID: <st7sfb$14na$2@gioia.aioe.org>
References: <zM6dnZ5wDbXEsGr8nZ2dnUU7_8zNnZ2d@giganews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="37610"; posting-host="FdrTMw7+RJa5kGNwdwd/KQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.5.0
Content-Language: fr
X-Notice: Filtered by postfilter v. 0.9.2
Bytes: 1948
Lines: 32

Le 31/01/2022 à 01:29, Cyrion81 a écrit :
> Bonsoir
> Je débute en python et j’ai voulu faire un programme qui ajoute un élément dans
> une liste, qui peut afficher la liste ainsi que quitte le programme.
> Je n’arrive pas a quitter le programme
> Merci de votre aide
> 
> choix =""
> liste_elements = []
> liste_choix=[1,2,3,4,5]
> while True:
> #menu choix affiché
>      choix =""
>      print( )
>      print("--------------------------------")
>      print("Choisissez parmi les 3options suivantes :")
>      print("1: Ajouter un élément à la liste.")
>      print("2: Afficher la liste.")
>      print("3: Quitter.")

> 
>      Je cherche a quitter le premier while ( le menu )uniquement si j ai fini
> toutes les opérarions et pressant la touche 3

Bonjour,

Vous débutez votre boucle avec while True:

Mas qu'est-ce qui est True ? Si rien n'est indiqué (comme while 
essai==True), je ne vois pas comment le while peut être testé.