4 ms·
A Python cheat sheet for those of us who do
- miratom 19y ago...and for those who have never seen a programming language ever. Do they really need arrows that point to comments that say, "This is a comment"?
- jsmcgd 19y agoThey don't need to but it succinctly highlights the fact that there are two different ways of commenting code in Python.
- pistoriusp 19y agoPretty disappointing.
- tim2 19y agoCould have at least used a dict. Makes me want to do one of these now though.
- thorax 19y agoI run/host a community of Python new entry-level scripters. This seems perfect for them to see so they'll understand a little more about what they're seeing. I'd welcome any other cheat sheets which you prefer, though. I was actually impressed at the clarity of this one because it's covered a lot of concepts that literally took a few forum posts to clarify for newbies.
- avinashv 19y agoNot a bad reference for newbies, but this lacks some important things (dictionaries, tuples, list comprehensions, lambdas etc.). Also, the arrow-style explanations don't lend well to a quick-search reference.
- anon 19y agoit's missing 'pass' which is essential if you wish for automatic indentation to work properly
- rbanffy 19y agoIsn't using a "main" function a C-ism? I have never heard of such a convention when programming in Python. Is there one? Does the BDFL know about it?
- hhm 19y agoNo, it's actually used. In this article the creator of Python talks about it: http://www.artima.com/weblogs/viewpost.jsp?thread=4829 http://www.artima.com/weblogs/viewpost.jsp?thread=4829