MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/4nd3lc/scientific_python_cheat_sheet/d43irhc/?context=3
r/Python • u/Link2mypast • Jun 09 '16
62 comments sorted by
View all comments
2
generators:
x = [for i in firstn(10)]
should be:
x = [i for i in firstn(10)]
2 u/Misterandrist Jun 10 '16 edited Jun 10 '16 Plus as written it demonstrates a list comprehension and not a generator (well... kind of) there's a difference between them that I think could be expressed more clearlyEdit: spelling 4 u/[deleted] Jun 10 '16 s/compression/comprehension 1 u/Misterandrist Jun 10 '16 Uf da. autocorrect strikes again.
Plus as written it demonstrates a list comprehension and not a generator (well... kind of) there's a difference between them that I think could be expressed more clearly
Edit: spelling
4 u/[deleted] Jun 10 '16 s/compression/comprehension 1 u/Misterandrist Jun 10 '16 Uf da. autocorrect strikes again.
4
s/compression/comprehension
1 u/Misterandrist Jun 10 '16 Uf da. autocorrect strikes again.
1
Uf da. autocorrect strikes again.
2
u/qu4ku Jun 10 '16 edited Jun 10 '16
generators:
should be: