Python Versions: 2 vs 3 (Don’t Worry, It’s 3 Now)
Ah yes, the great Python civil war: Python 2 vs Python 3.
It’s like Coke vs Pepsi, Marvel vs DC, or tabs vs spaces — except this one actually got resolved (sort of).
Let’s talk about what the fuss was all about, and why you can relax and just pick Python 3 — no existential crisis required.
Python 2: The Grumpy Grandpa of Python
Python 2 was released back in 2000, when floppy disks were a thing and people still used Internet Explorer on purpose.
It had a good run, but...
- It was never really designed with the future in mind.
- It had some "quirks" (read: features that made you question your life choices).
- And most importantly: It reached end-of-life on January 1st, 2020.
Yes, it’s officially retired. Gone fishing.
Still exists, but shouldn’t be used — kind of like Internet Explorer.
Python 3: The Chosen One
Python 3 came out in 2008 and was basically:
“Let’s fix everything Python 2 did weird and break a few things along the way.”
It introduced:
- Better Unicode support (aka non-English text doesn’t break everything).
- A cleaner, more consistent syntax.
- Saner division (we’ll get to that).
- And a ton of quality-of-life improvements that made Python feel more like a modern language and less like a haunted typewriter.
Key Differences (aka “Why Your Old Python Script Is Screaming”)
Feature | Python 2 | Python 3 |
---|---|---|
print syntax | print "hello" | print("hello") ✅ |
Integer division | 5 / 2 = 2 (surprise!) | 5 / 2 = 2.5 ✅ |
Unicode strings | Not default | Default ✅ |
xrange() vs range() | xrange() faster than range() | range() is already optimized ✅ |
Community support | Mostly abandoned 🪦 | Thriving ecosystem 🎉 |
Basically: Python 3 is cleaner, smarter, and doesn’t lie to you when you divide numbers.
Use Python 3. Always. Forever. (Unless you like pain.)
So... Why Was There Drama?
Because Python 3 wasn’t backward compatible, meaning your beautiful Python 2 code didn’t always work in Python 3.
Developers were like:
“You broke my script, Python. HOW COULD YOU.”
So for a while, both versions were used — like parallel universes.
But now that Python 2 is officially gone, even the old-school devs have moved on. (Well, most of them.)
How to Check Your Python Version ✅
In your terminal, run:
python --version
or
python3 --version
If you see something like Python 3.12.1
, great! You’re on the right track. If you see 2.7.x
, kindly uninstall it or seal it in a time capsule.