On 1/4/20 3:29 PM, William Johnsson wrote:
> Hello! My name is William and im 14 years old and live in sweden. Im
> pretty new to programing in python and i need some help with code,
> (That’s why i’m here). But i couldn’t really find what i was
> searching for on the internet. I’m trying to write
Hello! My name is William and im 14 years old and live in sweden. Im pretty
new to programing in python and i need some help with code, (That’s why i’m
here). But i couldn’t really find what i was searching for on the internet. I’m
trying to write code that can check only the first line in a .t
Greg Ewing writes:
> On 4/01/20 5:41 am, Alan Bawden wrote:
>>>So I was looking for a predefined object from the standard
>>>library that already /is/ an iterator (with no need to use
>>>»iter«).
>
> Why are you so intent on introducing either next() or iter() to
> beginning students?
Greg Ewing :
> You can pass a zip file with a .pyz extension to the python
> interpreter and it will look for a __main__.py file and run
> it.
This discussion has been interesting, and I've now learned about zipapp.
This is really nice and will likely be a favorite distribution format
for Python a
jezka...@gmail.com wrote:
> ok, so it could be like this?
Easy things to improve:
(1) Avoid iterating over indices.
Wrong:
for i in range(len(stuff)):
item = stuff[i]
...
Better:
for item in stuff:
...
(1a) If you need the index use enumerate():
for i, value in enumerate(stuff