Extract lines from file, add to new files

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jan 15 02:37:35 EST 2024


On 13/01/24 11:34 pm, Left Right wrote:
> To make this
> shorter, Python allows:
> 
> for <statement> in ... : ...
>

Um, no, it doesn't. An assignment target is not, on its own, a
statement.

It's hard to make sense of what you're saying. You seem to be
surprised by the fact that Python doesn't require variables to
be declared separately from their use. But this is a very common
feature of dynamic languages generally. As language oddities go,
it hardly rates a mention.

-- 
Greg


More information about the Python-list mailing list