Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #18: excess surge protection


comp / comp.lang.python / in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )

SubjectAuthor
* in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )HenHanna
`* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )Paul Rubin
 `* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )Phil Carmody
  `* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )candycanearter07
   +- Re: in Python: (101 102 103 201 ...) (Posting On Python-List Prohibited)Lawrence D'Oliveiro
   +- Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )Peter J. Holzer
   +* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )Phil Carmody
   |`- Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )candycanearter07
   +* Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )Phil Carmody
   |`- Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )candycanearter07
   `- Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )Peter J. Holzer

1
Subject: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
From: HenHanna
Newsgroups: comp.lang.python, rec.puzzles
Organization: A noiseless patient Spider
Date: Sun, 9 Jun 2024 23:42 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna@devnull.tb (HenHanna)
Newsgroups: comp.lang.python,rec.puzzles
Subject: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
Date: Sun, 9 Jun 2024 16:42:02 -0700
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v45eka$3s5s4$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Jun 2024 01:42:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fdf3da398add0912fb8385f840f76bc6";
logging-data="4069252"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wZqi9YzvB9oiq4j4WABi9aqFyu5mcFHw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:i5acQRA1TgK2pU4498BxUnuPUAE=
Content-Language: en-US
View all headers

# (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?

Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
From: Paul Rubin
Newsgroups: comp.lang.python, rec.puzzles
Organization: A noiseless patient Spider
Date: Mon, 10 Jun 2024 04:18 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.python,rec.puzzles
Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
Date: Sun, 09 Jun 2024 21:18:25 -0700
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <87v82hph0u.fsf@nightsong.com>
References: <v45eka$3s5s4$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 10 Jun 2024 06:18:32 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c2fe2a80c8b71093a482f71946a553d4";
logging-data="177445"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189k7wu3RoewSYUcrkfBiU/"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:NZZT7weKfXnJAMD+pJRA3Ve8k40=
sha1:3+UQnSJA7vX9fuuz3HYISIIZZ9U=
View all headers

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.

Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
From: Phil Carmody
Newsgroups: comp.lang.python, rec.puzzles
Organization: A noiseless patient Spider
Date: Thu, 13 Jun 2024 12:01 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+usenet@asdf.org (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, 13 Jun 2024 15:01:32 +0300
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <87bk45aw6b.fsf@fatphil.org>
References: <v45eka$3s5s4$2@dont-email.me> <87v82hph0u.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 13 Jun 2024 14:17:33 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="501e944e5cd87bd7dcbe1968d47d298a";
logging-data="2383841"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N9UvVVs01SmwR0l4w/6XE"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:bHGBG8CRTDNpO6CZJKuH6yg7ODw=
sha1:z2wPY5iI5BlrUGu39fj4YdSjUDo=
View all headers

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/

Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
From: candycanearter07
Newsgroups: comp.lang.python, rec.puzzles
Organization: the-candyden-of-code
Date: Fri, 14 Jun 2024 06:10 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.lang.python,rec.puzzles
Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
Date: Fri, 14 Jun 2024 06:10:06 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 22
Message-ID: <slrnv6nnel.30ai.candycanearter07@candydeb.host.invalid>
References: <v45eka$3s5s4$2@dont-email.me> <87v82hph0u.fsf@nightsong.com>
<87bk45aw6b.fsf@fatphil.org>
Injection-Date: Fri, 14 Jun 2024 08:10:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a5412a3b682daf598a5e904c68c6451b";
logging-data="2915018"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+eiZecOorRiRpU8DBgEhAmhV8iTS50kyJ+COlqFhkXmQ=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:gmTWxBp4/c9QJTK5e4oTiiz/sPU=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

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

Subject: Re: in Python: (101 102 103 201 ...) (Posting On Python-List Prohibited)
From: Lawrence D'Oliv
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Fri, 14 Jun 2024 07:18 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: in Python: (101 102 103 201 ...) (Posting On Python-List
Prohibited)
Date: Fri, 14 Jun 2024 07:18:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <v4gqsp$2pjn6$1@dont-email.me>
References: <v45eka$3s5s4$2@dont-email.me> <87v82hph0u.fsf@nightsong.com>
<87bk45aw6b.fsf@fatphil.org>
<slrnv6nnel.30ai.candycanearter07@candydeb.host.invalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 14 Jun 2024 09:18:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="439f0f0c18db64cf01b18b961500da43";
logging-data="2936550"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pGKY+MqUvimUACNj/CV0Y"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:lxSbD6CS1kqwjmMqSnS/jkzHPjY=
View all headers

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.

Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
From: Peter J. Holzer
Newsgroups: comp.lang.python
Date: Tue, 18 Jun 2024 21:26 UTC
References: 1 2 3 4 5
Attachments: signature.asc (application/pgp-signature)
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.building-m.net!news.quux.org!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-python@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
Date: Tue, 18 Jun 2024 23:26:50 +0200
Lines: 51
Message-ID: <mailman.155.1718748012.2909.python-list@python.org>
References: <v45eka$3s5s4$2@dont-email.me> <87v82hph0u.fsf@nightsong.com>
<87bk45aw6b.fsf@fatphil.org>
<slrnv6nnel.30ai.candycanearter07@candydeb.host.invalid>
<20240618212650.ijp5cv3hyl3iplsf@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="y56pak5wi7g3egds"
X-Trace: news.uni-berlin.de GWLH0heFIY148BqEzuaSJgVRvtOIzjsUng+THWuOYvGQ==
Cancel-Lock: sha1:qlzADnU7lmleqjQ+lA8kMpX6qkQ= sha256:LirLvdY9vA+7jU5cZuB3BXNIGrpSF9Ge+XdEwUqnxUQ=
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.005
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'content-
type:multipart/signed': 0.05; 'content-type:application/pgp-
signature': 0.09; 'filename:fname piece:asc': 0.09;
'filename:fname piece:signature': 0.09;
'filename:fname:signature.asc': 0.09; 'subject:Python': 0.12;
'syntax': 0.15; '"creative': 0.16; '__/': 0.16; 'challenge!"':
0.16; 'dots,': 0.16; 'from:addr:hjp-python': 0.16;
'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
'hjp@hjp.at': 0.16; 'holzer': 0.16; 'reality.': 0.16; 'stross,':
0.16; 'subject:401': 0.16; 'thursday': 0.16; 'url-
ip:212.17.106/24': 0.16; 'url-ip:212.17/16': 0.16; 'url:hjp':
0.16; '|_|_)': 0.16; 'wrote:': 0.16; "can't": 0.17; 'to:addr
:python-list': 0.20; "i'd": 0.24; '101': 0.26; 'sense': 0.28;
'python-list': 0.32; 'but': 0.32; 'there': 0.33; 'header:In-Reply-
To:1': 0.34; 'two': 0.39; 'wrote': 0.39; '203': 0.40; 'lack':
0.60; 'remember': 0.61; 'received:212': 0.62; '202': 0.64;
'received:userid': 0.66; '303': 0.69; 'url-ip:212/8': 0.69; '402':
0.84; 'beat': 0.84; 'exactly.': 0.84; 'received:at': 0.84;
'subject: )': 0.84; 'subject:: (': 0.84; '403': 0.91
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <slrnv6nnel.30ai.candycanearter07@candydeb.host.invalid>
X-Mailman-Approved-At: Tue, 18 Jun 2024 18:00:10 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <20240618212650.ijp5cv3hyl3iplsf@hjp.at>
X-Mailman-Original-References: <v45eka$3s5s4$2@dont-email.me>
<87v82hph0u.fsf@nightsong.com>
<87bk45aw6b.fsf@fatphil.org>
<slrnv6nnel.30ai.candycanearter07@candydeb.host.invalid>
View all headers

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!"

Attachments: signature.asc (application/pgp-signature)
Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
From: Phil Carmody
Newsgroups: comp.lang.python, rec.puzzles
Organization: A noiseless patient Spider
Date: Thu, 20 Jun 2024 14:20 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+usenet@asdf.org (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: <v45eka$3s5s4$2@dont-email.me> <87v82hph0u.fsf@nightsong.com>
<87bk45aw6b.fsf@fatphil.org>
<slrnv6nnel.30ai.candycanearter07@candydeb.host.invalid>
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=
View all headers

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/

Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
From: candycanearter07
Newsgroups: comp.lang.python, rec.puzzles
Organization: the-candyden-of-code
Date: Fri, 21 Jun 2024 06:10 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: candycanearter07@candycanearter07.nomail.afraid (candycanearter07)
Newsgroups: comp.lang.python,rec.puzzles
Subject: Re: in Python: (101 102 103 201 202 203 301 302 303 401 402 403 )
Date: Fri, 21 Jun 2024 06:10:04 -0000 (UTC)
Organization: the-candyden-of-code
Lines: 36
Message-ID: <slrnv7a5pt.5022.candycanearter07@candydeb.host.invalid>
References: <v45eka$3s5s4$2@dont-email.me> <87v82hph0u.fsf@nightsong.com>
<87bk45aw6b.fsf@fatphil.org>
<slrnv6nnel.30ai.candycanearter07@candydeb.host.invalid>
<87sex7ae6z.fsf@fatphil.org>
Injection-Date: Fri, 21 Jun 2024 08:10:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="deb476f1a0e5c17bb99e8813a49f2d53";
logging-data="3198114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1mpBG4CZoR0Nss5VBnYDNlHbWwCvYTx8oZTgng4Jztg=="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:WBSfXBhQg3T4Jv+0HXxyZeUTnpk=
X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]%
b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx
`~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e
ZrQsWJ >|l^I_[pbsIqwoz.WGA]<D
View all headers

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

1

rocksolid light 0.9.8
clearnet tor