Path: csiph.com!news.mixmin.net!aioe.org!FdrTMw7+RJa5kGNwdwd/KQ.user.46.165.242.91.POSTED!not-for-mail From: Dominique Newsgroups: fr.comp.lang.python Subject: Re: Simplifier le programme Date: Thu, 3 Feb 2022 06:20:04 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <3MmdnRwioJbLb2f8nZ2dnUU7_83NnZ2d@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="3286"; 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.1 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: fr Xref: csiph.com fr.comp.lang.python:3736 Le 02/02/2022 à 22:06, overskill a écrit : > Merci beaucoup à tous les deux, je ne savais pas qu'on pouvait faire aussi > simple. > Encore merci ! En repartant de ta base, tu pouvais aussi faire : from datetime import * month_day = [0,31,60,91,121,152,182,213,244,274,305] day = today.day month = today.month-1 print("Aujourd'hui, tu dois faire", day+month_day[month], "pompes")