Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Phil Carmody Newsgroups: comp.lang.python,rec.puzzles Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 ) Date: Thu, 20 Jun 2024 17:20:20 +0300 Organization: A noiseless patient Spider Lines: 35 Message-ID: <87sex7ae6z.fsf@fatphil.org> References: <87v82hph0u.fsf@nightsong.com> <87bk45aw6b.fsf@fatphil.org> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 20 Jun 2024 16:36:23 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d56e824359442d10287630f6b36e8625"; logging-data="2758768"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1886DG3td2VlLUBCToLOsl8" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cancel-Lock: sha1:2IIkDFMMKaDNtOyhOOLQMl2880k= sha1:Xa/ZGx3R9411s68kfSNQpcsFEks= Bytes: 2369 candycanearter07 writes: > 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 > > 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/