Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )

Liste des GroupesRevenir à cl python 
Sujet : Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
De : pc+usenet (at) *nospam* asdf.org (Phil Carmody)
Groupes : comp.lang.python rec.puzzles
Date : 20. Jun 2024, 15:20:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87sex7ae6z.fsf@fatphil.org>
References : 1 2 3 4
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
candycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
writes:

Phil Carmody <pc+usenet@asdf.org> wrote at 12:01 this Thursday (GMT):
Paul Rubin <no.email@nospam.invalid> writes:
HenHanna <HenHanna@devnull.tb> writes:
is there another (simple) way to write this?
>
Yes, but please consider doing these easy exercises yourself
instead of
fobbing them onto other people.
>
Hen's probably just an experimental GPT. You, with your limited
resources, can never train it.
>
I'd say you can't beat the verbosity, or lack thereof of just plain
zsh/bash:
  $ echo {1,2,3,4}0{1,2,3}
  101 102 103 201 202 203 301 302 303 401 402 403
>
I /think/ you can replace it with {1...4} and {1...3}? I know there is
some syntax for "range of numbers" but I can't remember it exactly.

You're right, but it's even shorter -
$ echo {1..4}0{1..3}
101 102 103 201 202 203 301 302 303 401 402 403

Good golfing!

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Date Sujet#  Auteur
10 Jun 24 * in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )8HenHanna
10 Jun 24 `* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )7Paul Rubin
13 Jun 24  `* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )6Phil Carmody
14 Jun 24   `* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )5candycanearter07
14 Jun 24    +- Re: in Python: (101 102 103 201 ...) (Posting On Python-List Prohibited)1Lawrence D'Oliveiro
18 Jun 24    +- Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )1Peter J. Holzer
20 Jun 24    `* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )2Phil Carmody
21 Jun 24     `- Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )1candycanearter07

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal