Before writing real programs, we must install Python on our computer. Without installing Python, we cannot run Python code.
1. What is Installation?
Installation means putting software into your computer so that it can work properly. Just like we install apps in mobile, we install Python to start programming.
2. Why Do We Need to Install Python?
- To run Python programs
- To use Python interpreter
- To connect our code with the system
Without installation, the computer will not understand Python language.
3. What is Python Interpreter?
Python interpreter reads your code line by line and executes it. That is why Python is called an interpreted language.
4. How to Install Python (Windows)
- Open browser (Edge or Chrome)
- Go to https://www.python.org
- Click Downloads
- Click Download Python (latest version)
- Open downloaded file
- Important: Tick "Add Python to PATH"
- Click Install Now
5. Check if Python is Installed
Open Command Prompt and type:
python --version
If installed correctly, you will see something like:
Python 3.12.0
6. Running Your First Program
Open Command Prompt and type:
python
You will see:
>>>
Now type:
print("Hello Python")
Output:
Hello Python
7. Using Code Editor (Recommended)
Instead of writing code in command prompt, we use code editor. Popular editors:
- VS Code (Recommended)
- PyCharm
- Notepad++
- Sublime Text
8. Creating Your First Python File
- Open VS Code
- Click File → New File
- Save as hello.py
- Write the following code:
print("Welcome to Python Zero to Hero")
Right click and choose Run Python File.
9. Command Prompt vs Code Editor
Command Prompt
- Good for quick testing
- Very basic
- Not professional
Code Editor
- Better for projects
- Auto suggestions
- Error highlighting
- Professional
10. Common Beginner Mistakes
- Forgetting to tick "Add to PATH"
- Saving file without .py extension
- Installing outdated version
- Writing code in Word document
Conclusion
Now your system is ready for Python programming. You learned how to install Python, check installation, and run your first program.
In the next article, we will write a complete Python program and understand how Python executes code step by step.
Your Zero to Hero journey continues.