Skip to content
📘 What is Python?
- Python is a simple, high-level, and interpreted programming language.
- Created by Guido van Rossum in 1991.
- Used for web apps, data science, AI, games, etc.
⚙️ Features of Python
- Easy to learn and use
- Free and open-source
- Portable (works on any OS)
- Interpreted (runs line by line)
- Object-oriented
- Has large libraries
💻 How to Run Python
- In IDLE (Python Shell)
- In a code editor (like VS Code or PyCharm)
- Using online compilers
🔤 Basic Syntax
- Print Output:
print("Hello")
- Comments:
# This is a comment
- Variables: store data →
x = 10
- Indentation: used for blocks of code (no
{})
🔢 Data Types
| Type | Example | Description |
|---|
| int | 10 | Whole numbers |
| float | 3.14 | Decimal numbers |
| str | “Hello” | Text |
| bool | True / False | Logical values |
🧮 Operators
| Operator | Example | Meaning |
|---|
| + | a + b | Addition |
| – | a – b | Subtraction |
| * | a * b | Multiplication |
| / | a / b | Division |
| % | a % b | Remainder |
🧠 Keywords
- Special reserved words in Python like:
if, else, for, while, def, True, False, import, etc.