Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.python > #3368
| From | Benoit Izac <use.reply.to@INVALID.ADDRESS> |
|---|---|
| Newsgroups | fr.comp.lang.python |
| Subject | Re: Pattern python programm |
| Date | 2020-11-03 15:31 +0100 |
| Message-ID | <87k0v2ecly.fsf@izac.org> (permalink) |
| References | <noCdnV-RmY46yTzCnZ2dnUU7983NnZ2d@giganews.com> |
Bonjour,
Le 03/11/2020 à 14:01, AchrafG a écrit dans le message
<noCdnV-RmY46yTzCnZ2dnUU7983NnZ2d@giganews.com> :
> Je suis débutant sur Python, j'essaye de pratiquer plus d'exercices
> pour apprendre.
> je me suis bloqué sur un exercice qui demande de tracer le le modèle
> ci-après en utilisant la boucle for et la boucle while :
> *
> ####*####
> ########*########
> ####*####
> *
> (les étoiles doivent être au centre)
>
> pouvez vous m'aider svp ?
Tu veux dire comme ça ?
*
####*####
########*########
####*####
*
Un petit coup de pouce :
>>> i=0
>>> '#'*i + '*' + '#'*i
'*'
>>> i=3
>>> '#'*i + '*' + '#'*i
'###*###'
Il reste encore un peu de travail pour arriver à produire le motif mais
ça devrait te donner une partie de la solution.
Tu peux poster ton code ici à l'issue.
--
Benoit Izac
Back to fr.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
Pattern python programm AchrafG <nospam_private.inobx@gmail.com.invalid> - 2020-11-03 07:01 -0600 Re: Pattern python programm Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2020-11-03 15:31 +0100 Re: Pattern python programm Pierre Maurette <maurette.pierre@free.fr> - 2020-11-03 19:02 +0100
csiph-web