Path: csiph.com!aioe.org!EIHAHS7HsjDij55hoUn2SA.user.46.165.242.91.POSTED!not-for-mail From: Dominique Newsgroups: fr.comp.lang.python Subject: Re: Autre exercice : calculer la somme de x chiffres. Date: Sun, 22 May 2022 17:11:02 +0200 Organization: Aioe.org NNTP Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gioia.aioe.org; logging-data="38112"; posting-host="EIHAHS7HsjDij55hoUn2SA.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.9.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: fr Xref: csiph.com fr.comp.lang.python:3862 Le 22/05/2022 à 17:00, Dominique a écrit : Inutile de passer par une composition de liste : def addition(x): return sum(range(x+1)) print (addition(int(input('Fin de la sommielle ')))) Difficile sans doute d'être plus concis...