sum(1 for _ in iter)
There should be one — and preferably only one — obvious way to do it. © Zen of Python
sum(1 for _ in iter) There should be one — and preferably only one — obvious way to do it. © Zen of Python 2 comments
Yes, this is how you do this, but in python |
@mo well there's one obvious way and then there's lots of other different kind of obvious ways :blobcatderpy: