Re: A technique from a chatbot

2024-04-05 Thread Mark Bourne via Python-list
Stefan Ram wrote: Mark Bourne wrote or quoted: I don't think there's a tuple being created. If you mean: ( word for word in list_ if word[ 0 ]== 'e' ) ...that's not creating a tuple. It's a generator expression, which generates the next value each time it's called for. If you only ever

Re: A technique from a chatbot

2024-04-05 Thread Mark Bourne via Python-list
e, imagine doing the search in parallel and as sone as it is found anywhere, ... -Original Message- From: Python-list On Behalf Of Mark Bourne via Python-list Sent: Thursday, April 4, 2024 3:04 PM To: python-list@python.org Subject: Re: A technique from a chatbot Thomas Passin wrote: O

Re: A technique from a chatbot

2024-04-04 Thread Thomas Passin via Python-list
On 4/4/2024 3:03 PM, Mark Bourne via Python-list wrote: Thomas Passin wrote: On 4/2/2024 1:47 PM, Piergiorgio Sartor via Python-list wrote: On 02/04/2024 19.18, Stefan Ram wrote:    Some people can't believe it when I say that chatbots improve    my programming productivity. So, here's a

RE: A technique from a chatbot

2024-04-04 Thread AVI GROSS via Python-list
, ... -Original Message- From: Python-list On Behalf Of Mark Bourne via Python-list Sent: Thursday, April 4, 2024 3:04 PM To: python-list@python.org Subject: Re: A technique from a chatbot Thomas Passin wrote: > On 4/2/2024 1:47 PM, Piergiorgio Sartor via Python-list wrote: >> On 0

Re: A technique from a chatbot

2024-04-04 Thread Mark Bourne via Python-list
Thomas Passin wrote: On 4/2/2024 1:47 PM, Piergiorgio Sartor via Python-list wrote: On 02/04/2024 19.18, Stefan Ram wrote:    Some people can't believe it when I say that chatbots improve    my programming productivity. So, here's a technique I learned    from a chatbot!    It is a structured

Re: A technique from a chatbot

2024-04-03 Thread Michael F. Stemper via Python-list
On 03/04/2024 13.45, Gilmeh Serda wrote: On 2 Apr 2024 17:18:16 GMT, Stefan Ram wrote: first_word_beginning_with_e Here's another one: def ret_first_eword(): ... return [w for w in ['delta', 'epsilon', 'zeta', 'eta', 'theta'] if w.startswith('e')][0] ... ret_first_eword() 'epsilon'

Re: A technique from a chatbot

2024-04-03 Thread Pieter van Oostrum via Python-list
r...@zedat.fu-berlin.de (Stefan Ram) writes: > It can lead to errors: > > def first_word_beginning_with_e( list_ ): > for word in list_: > if word[ 0 ]== 'e': return word > something_to_be_done_at_the_end_of_this_function() > > The call sometimes will not be executed

RE: A technique from a chatbot

2024-04-03 Thread AVI GROSS via Python-list
: A technique from a chatbot On 4/3/2024 1:27 AM, AVI GROSS via Python-list wrote: > I am a tad confused by a suggestion that any kind of GOTO variant is bad. The suggestion runs counter to the reality that underneath it all, compiled programs are chock full of GOTO variants even for simple things l

Re: A technique from a chatbot

2024-04-03 Thread Thomas Passin via Python-list
On 4/3/2024 1:27 AM, AVI GROSS via Python-list wrote: I am a tad confused by a suggestion that any kind of GOTO variant is bad. The suggestion runs counter to the reality that underneath it all, compiled programs are chock full of GOTO variants even for simple things like IF-ELSE. Consider

RE: A technique from a chatbot

2024-04-02 Thread AVI GROSS via Python-list
nt(first_word_beginning_with_e( text )) print(first_word_beginning_with_e( NorEaster )) Result of running it on a version of python ay least 3.8 so it supports the walrus operator: eastern None -Original Message- From: Python-list On Behalf Of Thomas Passin via Python-list Sent: Tue

Re: A technique from a chatbot

2024-04-02 Thread Thomas Passin via Python-list
On 4/2/2024 1:47 PM, Piergiorgio Sartor via Python-list wrote: On 02/04/2024 19.18, Stefan Ram wrote:    Some people can't believe it when I say that chatbots improve    my programming productivity. So, here's a technique I learned    from a chatbot!    It is a structured "break". "Break" still

Re: A technique from a chatbot

2024-04-02 Thread Piergiorgio Sartor via Python-list
On 02/04/2024 19.18, Stefan Ram wrote: Some people can't believe it when I say that chatbots improve my programming productivity. So, here's a technique I learned from a chatbot! It is a structured "break". "Break" still is a kind of jump, you know? So, what's a