Python Crash Course Cheat Sheet



Resources for the second edition are here. I'd love to know what you think about Python Crash Course; please consider taking a brief survey. If you'd like to know when additional resources are available, you can sign up for email notifications here.

More cheat sheets available at ehmatthes.github.io/pcc2e/ Storing data with json The json module allows you to dump simple Python data structures into a file, and load the data from that file the next time the program runs. The JSON data format is not specific to Python, so you can share this kind of data with. Python Cheat Sheet: Functions and Tricks “ A puzzle a day to learn, code, and play ” → Visit f inxter.com Description Example Result. General Python Resources; Data Science Resources; Django Resources; Survey; Mailing List. Recommended Reading, Django 3.1, and more (9/3/20) Adding Sound and Automating Game Play in Alien Invasion (4/3/20) Finding Employment, Understanding Django, and more (2/28/20) Python 3.8, Django 3.0, and more (12/13/19) Challenges and Beyond PCC (11/18/19. Python programming cheat sheet. Useful reference for beginners. Covers syntax, terminology, and more.

Python Crash Course Cheat Sheet

A few years ago I made a set of cheat sheets to go along with the first edition of Python Crash Course. I recently finished updating the cheat sheets to match the changes that were made to the second edition of the book.

Cheat sheets can be really helpful when you’re trying a set of exercises related to a specific topic, or working on a project. Because you can only fit so much information on a single sheet of paper, most cheat sheets are a simple listing of syntax rules. This set of cheat sheets aims to remind you of syntax rules, but also remind you of important concepts as well. You can click here and download all of the original cheat sheets in a single document.

An updated version of these sheets is also available through Leanpub and Gumroad. The updated version includes a sheet that focuses on Git basics, a printer-friendly b&w version of each sheet, and each sheet as a separate document. The updated versions are available at no cost on both platforms.

Individual Sheet Descriptions

  • Beginner’s Python Cheat Sheet
    • Provides an overview of the basics of Python including variables, lists, dictionaries, functions, classes, and more.
  • Beginner’s Python Cheat Sheet - Lists
    • Focuses on lists: how to build and modify a list, access elements from a list, and loop through the values in a list. Also covers numerical lists, list comprehensions, tuples, and more.
  • Beginner’s Python Cheat Sheet - Dictionaries
    • Focuses on dictionaries: how to build and modify a dictionary, access the information in a dictionary, and loop through dictionaries in a variety of ways. Includes sections on nesting lists and dictionaries, using an OrderedDict and more.
  • Beginner’s Python Cheat Sheet - If Statements and While Loops
    • Focuses on if statements and while loops: how to write conditional tests with strings and numerical data, how to write simple and complex if statements, and how to accept user input. Also covers a variety of approaches to using while loops.
  • Beginner’s Python Cheat Sheet - Functions
    • Focuses on functions: how to define a function and how to pass information to a function. Covers positional and keyword arguments, return values, passing lists, using modules, and more.
  • Beginner’s Python Cheat Sheet - Classes
    • Focuses on classes: how to define and use a class. Covers attributes and methods, inheritance and importing, and more.
  • Beginner’s Python Cheat Sheet - Files and Exceptions
    • Focuses on working with files, and using exceptions to handle errors that might arise as your programs run. Covers reading and writing to files, try-except-else blocks, and storing data using the json module.
  • Beginner’s Python Cheat Sheet - Testing Your Code
    • Focuses on unit tests and test cases. How to test a function, and how to test a class.
  • Beginner’s Python Cheat Sheet - Pygame
    • Focuses on creating games with Pygame. Creating a game window, rect objects, images, responding to keyboard and mouse input, groups, detecting collisions between game elements, and rendering text.
  • Beginner’s Python Cheat Sheet - matplotlib
    • Focuses on creating visualizations with matplotlib. Making line graphs and scatter plots, customizing plots, making multiple plots, and working with time-based data.
  • Beginner’s Python Cheat Sheet - Pygal
    • Focuses on creating visualizations with Pygal. Making line graphs, scatter plots, and bar graphs, styling plots, making multiple plots, and working with global datasets.
  • Beginner’s Python Cheat Sheet - Django
    • Focuses on creating web apps with Django. Installing Django and starting a project, working with models, building a home page, using templates, using data, and making user accounts.
Pdf

Available from No Starch Press and Amazon.

Resources for the second edition are here. I'd love to know what you think about Python Crash Course; please consider taking a brief survey. If you'd like to know when additional resources are available, you can sign up for email notifications here.

Python Crash Course Cheat Sheet Pdf

A Hands-On, Project-Based Introduction to Programming

This is a collection of resources for Python Crash Course, an introductory programming book from No Starch Press by Eric Matthes.

If you have any questions about Python Crash Course, feel free to get in touch:

Email: ehmatthes@gmail.com

Twitter: @ehmatthes

I'd love to know what you think of Python Crash Course. If you've worked through most or all of the book, please consider taking a brief survey.

Setup Instructions

Here you can find instructions for:

  • Installing and configuring Python (Chapter 1)
  • Installing and using pip (Chapter 12)
  • Installing Pygame (Chapter 12)
  • Installing matplotlib and Pygal (Chapter 15)
  • Creating a Virtual Environment (Chapter 18)
  • Deploying a Project to Heroku (Chapter 20)
  • Installing Python (Appendix A)

Downloading source code

The simplest way to get the online resources for the book is to click on the Download .zip button at the top of this page, which will download the source code files and other resources for the entire book.

Cheat sheets can be really helpful when you're working on a set of programming exercises or a project. This set of cheat sheets will help remind you of the concepts you're learning, as well as the Python syntax for these concepts.

Some of the libraries featured in the book have been updated recently, which is a good thing - it means you're learning to use Python packages that are steadily being improved.

When packages are updated you have the option of using the version that was featured in the book, which lets you run code exactly as it's written in the book. You can also choose to install the latest version of each package, and modify the code in the book slightly. Each approach is outlined clearly in these updates.

A list of updates is kept here.

Beginner python cheat sheet

Python Crash Course Help

Solutions are available to selected exercises. Be careful about looking at the solutions too quickly; make sure you've given yourself time to wrestle with the concepts you just learned before looking at a solution. Also, there are several ways to solve most of the exercises, and the solutions only show one possible way to complete each exercise.

You can get to each chapter's solutions from here.

People have a wide variety of reasons for learning to code, and finding work as a programmer is one of the most common reasons. I posted a section called Finding Employment as a (New) Programmer in the resources for the second edition of the book. There's nothing specific about the second edition in these resources; if you are reading Python Crash Course with the goal of finding work as a programmer, you might find this section helpful.

Python Crash Course Cheat Sheet

Available from No Starch Press and Amazon.