Hey Grokking Python readers!
Did you know the Python programming language is named after Monty Python, and not the snake?
Well we don't care about that… for this edition of Grokking Python, we want to discuss an important and under-discussed topic: How is learning Python like getting a pet python?
As homonyms, the Python programming language and python snake are entirely different things. Still, if you're new to either of them, there are a few commonalities between learning Python and caring for a python. If you're interested in both of these endeavors, this edition is especially for you.
Without further ado, here are 9 ways that learning Python is like getting a pet python.
1. You need to provide them with a proper environment 🌳
Technically, you can write Python code anywhere. You can tweet and email Python code to folks all day for all we care. But if you want that code to run and do something, you need to put that code into a code editor or integrated development environment (IDE). Code editors and IDEs are software tools in which you can execute code, debug code, and more.
If you're on the hunt for an environment to write Python code in, check out our team's picks for the top 10 Python code editors and IDEs.
Similarly, you can't just maintain a pet python anywhere. You need to provide it with a living environment with suitable temperature, humidity, and lighting. It's also a good idea to give it some walls and a ceiling to keep it from escaping…
2. They might make you or others anxious 😬
People can get anxious about both coding and snakes. If you find that you get anxious about either, just know that you're not alone – and it can get better!
Anxiety around coding is called coding anxiety. Coding anxiety has discouraged many people from learning to code. It even follows developers who have been coding for years. If you relate to this, we suggest reading up about coding anxiety and tips for managing it.
Similarly, pet pythons might stir up some anxiety for you, your friends, or your family. Snakes have gotten a bad "wrap" since some species can be deadly to humans. However, pythons can certainly be harmless pets. To help make snakes feel more friendly, you might want to try the tip we pitch in the next section.
3. They can benefit from add-ons ➕
You can benefit from using add-ons for both Python and pet pythons.
From packages to libraries, there are various add-ons you can install to give more functionality to your Python projects. Each add-on will give you different features, pre-written code, or functionalities for specific use cases, including:
Data science and machine learning: NumPy, Pandas
Finance: FinPy, Skikit-learn
Web development: Requests, Beautiful Soup
Scientific research: SciPy, CliMT
Game development: PyGame, pyglet
Pet pythons also enjoy (or rather, might not mind) add-ons and accessories. If anyone's afraid of snakes, are they still afraid if the snake is donning a handmade hat or sweater from Etsy? Now there's a nice DIY trick for soothing snake anxiety. (Disclaimer: we are NOT mental health professionals.)
4. They manifest in sizes big and small 📦
You can use Python for small projects (like making an alarm clock), all the way up to large projects (such as analyzing swathes of big data).
Similarly, pet pythons come in various sizes, from the small children's python to the larger Burmese python.
5. They can be good for beginners 🌱
According to the StackOverflow 2022 Developer Survey, Python ranked in the top 3 programming languages used by those who are learning to code.
Because of its high-level nature and easy syntax, Python is considered a great programming language for beginners.
Similarly, some types of pythons are considered great choices for first-time snake parents. One good first-timer option is the ball pythons, relatively small pythons with a calm demeanor.
6. They love mice 🐁
The Python language likes the clicking type, while pet pythons prefer the squeaking type. They certainly have a different relationship with their respective mice though.
7. You can leverage neural networks to train them 🧠
The Python programming language has no brain, but you can apply deep learning – a subset of machine learning – to train artificial neural networks modeled after animal brains. This is a more advanced skill, so beginners should wait to tackle Python neural networks. In any case, it's a goal you can keep on your radar, and we think it's pretty darn cool.
As shown in the diagram, pet pythons have real-life animal brains. As with many creatures with brains, you can train your python and effectively encourage and discourage certain behaviors.
8. You can play the snake game with them 🎮
You can build the snake game with Python! Check out this tutorial to try it for yourself: Build a snake game in Python.
Many pythons only need to eat a few times a month, so the snake game's premise of excessively feeding a snake in an enclosed space is not safe or ethical for pet pythons! Instead, let your snake decide its favorite game to play with you. Because a snake might be stressed in its new home environment, you might want to start with a low-contact game, such as a stare-off.
9. You get better with time and practice 🕰
As a beginner in any endeavor, you might make mistakes. Common mistakes new Python programmers make can include using improper indentation or improper syntax. First-time snake owners often make mistakes such as overhandling snakes – this stresses snakes out, as they aren't social creatures.
It's okay to make mistakes. What's important is that you learn from them, and do your best to prevent them by researching best practices.
On to the learning! 📚
We can't really help you with next steps for getting a pet python, but learning Python is what we're all about.
Check out some of these helpful resources:
A curated list of our team's favorite online Python courses
This blog post with 7 coding challenges for learning Python
This article covering important Python data structures: lists, sets, and tuples
This guide on installing and getting started with Python
The Hitchhiker's Guide to Python: a collection of Python resources
Coding best practices to help you start out on the right foot
As always, happy learning!
Can you think of other similarities between Python and pythons? Let us know in a comment below!