- Published at
Mario Python Cheatsheet
The Python cheatsheet I wish I had when I first started learning Python.
Table of Contents
Introduction
When I first started learning Python, I found myself constantly Googling the basics. I’d make a little progress here and there, but found myself stuff stuck on simple, quick items. I think it’s because a lot of examples use random numbers and lists, etc. that didn’t stick with me. As a huge Nintendo and Mario fan, I created this fun cheatsheet that explains Python concepts using examples from Mario Bros.
Python Cheatsheet
Data Types
Variables
Operators
String Operations
Basic List Operations
Tuples
Dictionaries
Sets
Basic Functions
For Loops
While Loops
Putting It All together
Here’s an example to tie everything together.
Final Thoughts
-
Use meaningful variable names - player_lives is better than pl
-
Use comments to explain WHY, not WHAT (the code should be self-explanatory)
-
Start with simple built-in functions before moving to complex libraries
-
Practice using the interactive Python shell (REPL) to test small code snippets
Remember, everyone begins with the basics. I’m a big believer in learning the fundamentals before branching out to more advanced topics. Coding has never been my strongest skill so practice and persistence are key. More to come as I have some fun project ideas in mind for 2025!