What Python is
Python is a high-level, general-purpose programming language created by Guido van Rossum and first released in 1991. "High-level" means you write instructions that read almost like English, and the Python interpreter translates them for the computer. "General-purpose" means it is not tied to one job: the same language builds websites, analyses data, trains machine-learning models, automates boring office tasks, controls robots and powers the back ends of companies like Instagram, Spotify, Netflix and NASA.
The design of Python is built around one idea: readability counts. Where other languages use curly braces and semicolons, Python uses indentation and plain words. Here is a complete program that prints a greeting five times:
for i in range(5):
print("Hello, Python!")Even if you have never written code, you can probably guess what that does. That is the whole point of the language.
What Python is used for
Python is the most-taught first language in universities and consistently ranks first or second in the TIOBE, PYPL and Stack Overflow popularity surveys. The reason is the breadth of things it is used for:
- Data science and analytics — pandas, NumPy and Matplotlib turn spreadsheets and databases into charts and insights.
- Machine learning and AI — TensorFlow, PyTorch and scikit-learn are all Python-first. Most modern AI research code is written in Python.
- Web development — Django, Flask and FastAPI run the servers behind millions of websites and APIs.
- Automation and scripting — renaming a thousand files, scraping a website, sending scheduled emails or filling in forms: a few lines of Python replace hours of clicking.
- Education — Python is the language used in most introductory computer-science courses, coding bootcamps and school curricula because it lets students focus on ideas rather than syntax.
- Games, desktop apps and hardware — Pygame, Tkinter, Kivy, Raspberry Pi and MicroPython on microcontrollers.
Why Python is the best first language
If you are choosing your first programming language, Python has three concrete advantages:
- Short feedback loop. Python is interpreted, so you type a line, run it and see the result immediately. There is no separate compile step to wait for.
- Batteries included. The standard library ships with modules for JSON, dates, maths, random numbers, regular expressions, file handling and networking, so you can build useful things before learning how to install packages.
- Transferable concepts. Variables, loops, functions, classes and error handling work the same way in every language. Python lets you learn them without fighting the compiler.
The language does have trade-offs. It is slower than C or Rust for raw number crunching, and it is not the native language of iOS or Android apps. For a beginner those rarely matter; for a professional, Python usually sits alongside another language rather than replacing it.
Python 2 vs Python 3
You will occasionally see code written for Python 2. That version reached end of life on 1 January 2020 and is not maintained. Everything on this site — and everything inside the Coding Python app — uses Python 3. The quickest way to tell them apart: Python 2 wrote print "hello" without brackets, Python 3 writes print("hello"). If a tutorial you find online uses the bracket-free form, it is out of date.
How to run Python code
There are three practical ways to run Python, and you should pick whichever gets you writing code fastest:
| Where | How | Best for |
|---|---|---|
| Desktop / laptop | Install Python from python.org, then run python3 file.py in a terminal or use an editor such as VS Code or IDLE. | Larger projects, installing third-party packages |
| Android phone | Install the Coding Python compiler app. It bundles a real CPython interpreter so code runs on the phone with no account. | Learning anywhere, practising on the bus, quick experiments |
| Browser | Online Python compilers send your code to a server and show the result. | Sharing snippets, quick checks when you have internet |
Every tutorial in this learn Python series has been run on the phone app, so you can follow along entirely on Android if you want to.
Your first program, explained line by line
name = input("What is your name? ")
print("Nice to meet you,", name)
print(f"Your name has {len(name)} letters.")input()pauses the program, shows the prompt, and returns whatever the user types as text.name = ...stores that text in a variable calledname.print()writes to the screen. Separate items with commas and Python adds a space between them.f"..."is an f-string: anything inside curly braces is evaluated and inserted into the text.len()counts characters.
That is four lines and you have already used a function, a variable, string formatting and user input. The next lesson looks at variables and data types properly.
Frequently asked questions
Is Python free?
Yes. Python is open source under the PSF licence and free for personal and commercial use. The Coding Python app that runs it on Android is also free to download.
Is Python hard to learn?
Python is widely considered the easiest mainstream language to learn because its syntax is close to English and it gives instant feedback. Most beginners write useful scripts within their first week.
Do I need a computer to learn Python?
No. A real Python 3 interpreter runs on Android phones inside the Coding Python app, with a code editor, examples, quizzes and challenges. A computer helps later for larger projects.
Which Python version should I learn?
Python 3. Python 2 reached end of life in 2020. Any current 3.x release (3.10 and newer) is fine for learning; the syntax in these tutorials works on all of them.