📘 Who Is This Python Guide For?
This guide is for you if:
- 💻 You’re completely new to programming and want to start with Python.
- 🧑💻 You work in IT support / sysadmin and want to automate small tasks.
- 🌐 You want to move toward web development, data, or automation later.
- 🎓 You’re a student and need a clear, practical explanation – not theory only.
The goal is simple: By the end of this blog, you should understand Python basics enough to write small programs on your own.
1️⃣ What Is Python and Why Is It So Popular?
Python is a high-level, general-purpose programming language. That means you can use it for many types of projects:
- 🌐 Web applications (Django, Flask, FastAPI)
- 📊 Data analysis & Machine Learning (Pandas, NumPy, Scikit-learn)
- 🤖 Automation & scripting (file operations, API scripts, DevOps tasks)
- 🕹️ Simple games & tools (Pygame and others)
Python is loved because:
- ✅ Easy to read – almost like English.
- ✅ Huge community & plenty of tutorials.
- ✅ Libraries for almost everything.
- ✅ Works on Windows, macOS and Linux.
2️⃣ How Does Python Run? (Interpreter vs Script)
Python is an interpreted language. That means:
- You write code in a file like
script.py. - You run it using the
pythonorpython3command. - Python reads and executes the file line by line.
You usually work with Python in three ways:
- Interactive shell: type
pythonand run commands one by one. - Script file: write code in
.pyfile and execute it. - IDE/Editor: VS Code, PyCharm, etc., with debugging and extensions.
3️⃣ Step 1 – Installing Python
The exact steps depend on your OS, but the high-level flow is similar.
🔹 On Windows
- Go to the official site:
https://www.python.org→ Downloads → Windows. - Download the latest stable version (e.g., 3.x).
- Important: On the installer, check
Add Python to PATHbefore clicking Install. - Open
cmdand run:python --version
orpy --version
If you see a version number, you’re ready.
🔹 On macOS
- You can install from the official site or via Homebrew:
brew install python
- Then confirm:
python3 --version
🔹 On Linux
- Most distros already ship with Python 3.
- You can check using:
python3 --version
- If needed, install via your package manager (e.g.,
apt,dnf).
4️⃣ Step 2 – Your First Python Program
Let’s print the classic “Hello, World!”.
- Create a file named
hello.py. - Add this line:
print("Hello, World!") - Open your terminal / CMD in that folder and run:
python hello.py
orpython3 hello.py
You should see:
Hello, World!
- Python is properly installed and added to PATH.
- You’re in the correct folder where
hello.pyis located.
5️⃣ Variables & Basic Data Types
In Python, a variable is just a name that stores a value.
x = 10 # integer price = 19.99 # float name = "Rabby" # string is_active = True # boolean
Common Data Types
- int – whole numbers (1, 2, 100)
- float – numbers with decimal (3.14, 0.5)
- str – text (strings)
- bool – True or False
Basic Operations
a = 5 b = 2 print(a + b) # 7 print(a - b) # 3 print(a * b) # 10 print(a / b) # 2.5 print(a // b) # 2 (integer division) print(a % b) # 1 (remainder)
6️⃣ Input and Output
To take input from the user, use input().
It always returns a string, so convert if needed.
name = input("Enter your name: ")
print("Hello,", name)
For numeric input:
age = int(input("Enter your age: "))
print("You will be", age + 1, "next year.")
7️⃣ Conditions – if / elif / else
Conditional statements let your program make decisions.
age = int(input("Enter your age: "))
if age < 18:
print("You are a minor.")
elif age < 60:
print("You are an adult.")
else:
print("You are a senior.")
print).
In Python, indentation is not just style – it defines code blocks.
Use 4 spaces per level (or configure your editor to do it automatically).
8️⃣ Loops – for and while
🔹 for loop
Used to iterate over a sequence (range, list, string, etc.).
for i in range(1, 6):
print("Number:", i)
🔹 while loop
Runs as long as a condition is True.
count = 1
while count <= 5:
print("Count:", count)
count += 1
9️⃣ Lists & Dictionaries (Very Important)
🔹 Lists
A list is an ordered collection of items.
fruits = ["apple", "banana", "orange"]
print(fruits[0]) # apple
fruits.append("mango") # add item
print(fruits)
🔹 Dictionaries
A dictionary stores data as key–value pairs.
user = {
"name": "Sajid",
"role": "IT Support",
"active": True
}
print(user["name"])
print(user.get("role"))
🔟 Functions – Reusable Blocks of Code
A function lets you group logic and call it whenever needed.
def greet(name):
print("Hello,", name, "- welcome to Python!")
greet("Rabby")
greet("Fahad")
You can also return values:
def add(a, b):
return a + b
result = add(10, 5)
print("Result:", result)
1️⃣1️⃣ Modules & pip (Installing Packages)
Python has a huge ecosystem of reusable packages.
- pip is the package manager for Python.
- You can install external libraries like:
requestsfor HTTP APIspandasfor data analysis
pip install requests
Then use in your script:
import requests
response = requests.get("https://api.github.com")
print(response.status_code)
1️⃣2️⃣ Mini Practice Ideas (Daily Routine)
To really learn Python, you must type code yourself. Try this small routine:
- Write a script that asks for your name and age and prints a short intro.
- Write a script that prints numbers 1 to 50 but:
- Print “Fizz” for multiples of 3.
- “Buzz” for multiples of 5.
- “FizzBuzz” for multiples of both.
- Create a list of 5 IT tools you like and print them one by one in a loop.
- Create a dictionary for a user (name, job title, city) and print a formatted message.
✅ Final Thoughts – Where to Go Next
Python is a great first language, but this is just step one. From here, you can:
- Move into web development (Flask, Django).
- Explore automation scripts for IT (backups, log parsing, API calls).
- Start with data analysis (Pandas, Jupyter Notebooks).
Don’t rush. Pick a small project that solves a real problem for you (e.g., renaming files, parsing a CSV, simple report) and build it in Python. That’s how you move from “watching tutorials” to actually being a Python developer.