Why choose Python?
1 / 8Why choose Python?
Python is a programming language built to be easy to read. You spend your effort on the problem, not on the punctuation.
Six reasons to pick it: readable code, batteries included, many jobs, a huge community, career value, and trade-offs you can live with.
In this topic
Easy to read and write
Python code looks like a recipe: short steps, one per line, in plain words.
if age >= 18:
print("adult")
You can guess what it does before you learn the rules.
No braces, no semicolons. The spaces at the start of a line say what belongs together, so all Python code is laid out the same way.
A complete program can be one line:
print("Hello, world!")
No separate compile step. Type python hello.py and it runs, or try single lines at the >>> prompt.
Batteries included
Like a toy that comes with the batteries in the box: a lot works the moment Python is installed.
Ships with Python: files, dates, maths, JSON, CSV, web requests, testing and much more. Nothing extra to install.
The Python Package Index: hundreds of thousands of free packages that other people have written and shared.
pip install requests downloads a package from PyPI and makes it ready to import.
One language, many jobs
A Swiss army knife: learn it once, use it for very different kinds of work.
Django, Flask and FastAPI run websites and APIs.
pandas, NumPy and Jupyter notebooks: load a table, clean it, chart it.
PyTorch, TensorFlow and scikit-learn. Python is the everyday language of this field.
Rename a thousand files, fill in a report, call a web service. A boring manual task becomes a short script.
Widely used in research labs, and a common first language in schools and universities.
A huge community
You are never the first person with your problem. Someone has already asked, and someone has already answered.
Search for an error message and you will usually find an explanation and a fix.
The official tutorial at docs.python.org, plus countless free courses, books and videos.
No licence fee, for any use. The non-profit Python Software Foundation looks after the language.
Windows, macOS and Linux. The same code usually runs on all three.
Good for your career
A skill that opens many doors: Python shows up in job adverts far beyond pure programming roles.
Python has been at or near the top of the popularity rankings for years.
Google, Instagram, Netflix, Spotify and NASA all rely on it.
Analysts, scientists, testers and system administrators use Python as a tool for their own work.
Variables, loops, functions and classes work much the same elsewhere, so what you learn carries over to the next language.
Know the trade-offs
No tool is best at everything. Python trades some machine speed for a lot of human speed.
Pure Python code runs slower than compiled code. Often it does not matter: the heavy libraries, such as NumPy, are written in C underneath.
Rarely the first choice for phone apps, code that runs in the browser, or big 3D games.
Python does not check types before running, so some mistakes show up late. Tests and type hints catch them earlier.
Start in Python. Move one part to a faster language only when you have measured that it is too slow.