So I started a Python course, and I'm going to write down what I learn each day here. Mostly for me, but maybe it helps someone else too.
What is Python?
Python is a general purpose, high level programming language. "High level" just means it's easy for humans to read. Compare this:
no1 = 10
no2 = 20
print(no1 + no2)
with assembly, which is much closer to what the machine understands:
MOV AL, 10
MOV BL, 15
ADD AL, BL
Yeah. I'll take Python.
Where is Python used?
Pretty much everywhere:
- Data Science, ML, AI (handles huge data well)
- Web apps (Django, Flask)
- Desktop apps, scripting, automation
- Games, IoT, network programming
A bit of history
- Python came out in 1991 (Java in 1995)
- Python 2 in 2000, Python 3 in December 2008
- Python 3 isn't fully backward compatible with Python 2, which is why everyone just uses Python 3 now
Compiled vs Interpreted
- Compilation = translate the whole program at once
- Interpretation = translate line by line
Python is an interpreted language. There are also different implementations: CPython (the normal one, written in C), Jython (Java), IronPython (.NET), PyPy.
Pros and cons we discussed
Good: simple, open source, interpreted, extensible, high level, platform independent, dynamically typed.
Not so good: slower than C/C++/Java, uses more memory, type errors show up only at runtime, and it's not really used for mobile apps.
Small fun thing to try:
import sys
print(sys.copyright)
That's Day 1.
Top comments (0)