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

    From HenHanna@21:1/5 to All on Sun Jun 9 16:42:02 2024
    XPost: rec.puzzles

    # (101 102 103 201 202 203 301 302 303 401 402 403 )


    print( [ x+i for x in range(100,401,100) for i in range(1,4) ] )


    is there another (simple) way to write this?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to HenHanna on Sun Jun 9 21:18:25 2024
    XPost: rec.puzzles

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Phil Carmody@21:1/5 to Paul Rubin on Thu Jun 13 15:01:32 2024
    XPost: rec.puzzles

    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

    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/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From candycanearter07@21:1/5 to Phil Carmody on Fri Jun 14 06:10:06 2024
    XPost: rec.puzzles

    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

    Phil


    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.
    --
    user <candycane> is generated from /dev/urandom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Fri Jun 14 07:18:49 2024
    On Fri, 14 Jun 2024 06:10:06 -0000 (UTC), candycanearter07 wrote:

    I /think/ you can replace it with {1...4} and {1...3}?

    Two dots, not three. Bash extension.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter J. Holzer@21:1/5 to All on Tue Jun 18 23:26:50 2024
    On 2024-06-14 06:10:06 -0000, candycanearter07 via Python-list wrote:
    Phil Carmody <pc+usenet@asdf.org> wrote at 12:01 this Thursday (GMT):
    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.

    Only two dots, not three:

    % echo {1..4}0{1..3}
    101 102 103 201 202 203 301 302 303 401 402 403

    hp

    --
    _ | Peter J. Holzer | Story must make more sense than reality.
    |_|_) | |
    | | | hjp@hjp.at | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmZx+5UACgkQ8g5IURL+ KF3ALA//TaPUPtJkRj1DGsC2rUhFWy1s9qdhaQH3V56eS/3TzL93+1uMurBHVgsC XSJQym3sNTwMkqGn6moF0CpQ1009liFLuqx6m1gvGzSbXuICDFdi+6ROYfpkI9q8 esrs64xDP4gxma8xVNKCPMQpj779YMmot0nbs2PtodwqNulBY79DGOBwKB/ZjBbA Mp0qGiSRB/D7xgLHkH/DJEivvlLBvjGW73tfs74PkYIdWTt70wpYAv6ePHpvsz3n qCCmAvHCh3u1VaMrLyv5AI2S1/QT2uJ+JVE11QqdFRmg0DR3a0pddCPre3FjtEad fn5brQm+3MvycAXi0t5CY5kM89YtRv1ufcnYkx95XMMTQesB27H9Tw/F43UNCLUE 0bAlVsJTWcabzp2FjieraTldqJjc7qOgkFGI6M5gM9idZGC4MGXz8GeB6Ktr0yBh uk4CipjccBwsDSm3FJOAHpQ3cs4/X7W94wBzxrcll+6j56m+H8XRCbU7ZSu0VZC7 n0tDdrhbF9e7GLQAf+NpUI2GdILFFOTeCklhd4xhzqbXwIuxiRXo/k0J8fMBZqYQ TYYk/zJdlJFuDv1RDBnbYqHto+FhyX6AHyuZDb1fhpZ6rRDSWL43CVMFi7WEo+nc UAE8OzuB0zSlbKju9LS9OCw1YCem8HT317XYRiK
  • From Phil Carmody@21:1/5 to All on Thu Jun 20 17:20:20 2024
    XPost: rec.puzzles

    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/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From candycanearter07@21:1/5 to Phil Carmody on Fri Jun 21 06:10:04 2024
    XPost: rec.puzzles

    Phil Carmody <pc+usenet@asdf.org> wrote at 14:20 this Thursday (GMT):
    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


    Thanks :D
    --
    user <candycane> is generated from /dev/urandom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)