Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
On 2024-06-14 06:10:06 -, candycanearter07 via Python-list wrote: > Phil Carmody 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. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list
Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
Phil Carmody wrote at 12:01 this Thursday (GMT): > Paul Rubin writes: >> HenHanna 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 is generated from /dev/urandom -- https://mail.python.org/mailman/listinfo/python-list
Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
Paul Rubin writes: > HenHanna 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/ -- https://mail.python.org/mailman/listinfo/python-list