r/learnpython • u/ehmatthes • Aug 16 '16
Beginner's Python cheat sheets - updated
In the spring I posted a set of cheat sheets aimed at beginners, and many people found them useful. I've since completed the set of sheets, and wanted to share the full set. The additional sheets cover files and exceptions, testing, Pygame, matplotlib, Pygal, and Django.
You can download individual sheets, or download a pdf that includes all the sheets in one document. These sheets aim to remind you of Python's syntax, but they also include brief explanations of the concepts behind the syntax as well.
I wrote these sheets as supporting documentation for readers of Python Crash Course, but I think they're useful for beginners in general. I hope you find them helpful, and I'm happy to answer any questions about them.
1
u/[deleted] Aug 16 '16
I don't know what I saw that was wrong, but it was probably a mistake on my part. Sorry about that. Some suggestions though:
To make a list of numbers 1 to 1 million:
since range returns a list (ie list() is unnecessary)
For reverse, you can generate a reversed list with slicing:
I also believe this is a very useful feature in general that should be explained (iterating backwards).
I also believe that it complicates the explanations that everything is assigned to a value, and that you 'print' that value without showing what the result will actually be.
Other than that, it is a great cheat sheet. I'll definitely keep one handy :)