Python is a free, high-level programming language known for clean, readable code. It is the most popular language for data science, machine learning and AI, and it is also used for web apps, automation, scripting and teaching programming.
What You Will Learn
- What Python is and why it is so popular
- Where Python is used
- How Python runs your code
- Your first Python program
- How to start learning Python on this site
Prerequisites
None – this is the first lesson.
Why Python?
| Feature | What it means for you |
|---|---|
| Easy to read | Code looks almost like English, so beginners learn fast |
| Huge library ecosystem | NumPy, pandas, scikit-learn, TensorFlow, Django, Flask… |
| Cross-platform | Runs on Windows, macOS, Linux and even in the browser |
| Free and open source | No licence fee |
| Large community | Answers, tutorials and packages for almost everything |
Where Is Python Used?
| Area | Popular tools |
|---|---|
| Data science and analytics | NumPy, pandas, Matplotlib |
| Machine learning and AI | scikit-learn, TensorFlow, PyTorch, Hugging Face |
| Generative AI apps | OpenAI, Gemini and Claude SDKs, LangChain |
| Web development | Django, Flask, FastAPI |
| Automation and scripting | os, pathlib, requests, Selenium |
| Computer vision | OpenCV |
Your First Program
print("Hello, Python!")
name = "Riya"
year = 2026
print(f"Hi {name}, welcome to Python in {year}!")
Hello, Python! Hi Riya, welcome to Python in 2026!
Explanation: print() shows output. Variables are created simply by assigning a value – no type declaration needed. An f-string (f"...") puts variables inside text. Try it now in the Online Python Editor.
How Python Runs Code
Python is an interpreted language: the Python interpreter reads your .py file, compiles it to bytecode and runs it line by line. You do not need a separate compile step, which makes experimenting fast. Python is also dynamically typed – a variable’s type is decided when the program runs.
Python vs Other Languages
| Python | Java | C++ | |
|---|---|---|---|
| Syntax | Short, indentation-based | Verbose | Complex |
| Speed | Slower (but libraries are fast C code) | Fast | Fastest |
| Typical use | Data, AI, scripting, web | Enterprise, Android | Systems, games |
How to Learn Python Here
- Install Python (or use the online editor).
- Learn the basic syntax, variables, operators, decisions and loops.
- Master data structures: strings, lists, tuples, sets and dictionaries.
- Write functions, use modules and handle files and errors.
- Learn object-oriented programming.
- Move on to NumPy and pandas – see the Learning Paths.
Series
Python series: What is Python · Installation · Syntax · Variables · Operators · Decisions · Loops · Strings · Lists · Dictionary · Functions · Lambda · Modules · Files · Exceptions · OOP · Classes & Objects · Inheritance · Decorators · Generators · Virtual Environments
Interview Questions
Q: Is Python compiled or interpreted?
It is compiled to bytecode and then interpreted by the Python virtual machine; in practice it is called an interpreted language.
Q: What does dynamically typed mean?
Variable types are determined at runtime, not declared in advance.
Practice Exercises
- Print your name, city and favourite programming language on three lines.
- Store two numbers in variables and print their sum using an f-string.
Summary
Python is a free, readable, general-purpose language with a huge ecosystem, which makes it the first choice for data science, AI and automation.
Machine Learning Tutorials, Courses and Certifications