A small quiz

Alan Bawden alan at csail.mit.edu
Fri Jan 3 11:41:38 EST 2020


ram at zedat.fu-berlin.de (Stefan Ram) writes:
...
>   So I was looking for a predefined object from the standard
>   library that already /is/ an iterator (with no need to use
>   »iter«).
> 
>   I found exactly one such object (which can be used after a
>   »from ... import ...« statement). Can you guess what it is?

Well, there's sys.stdin.  

But I would expect beginning students to find the effect of typing
"next(sys.stdin)" to the commnd prompt to be a bit confusing...

-- 
Alan Bawden


More information about the Python-list mailing list