Level 0 → Infinity Setup Lesson
Programmers Picnic AI-ML Classes by Champak Roy
In this lesson, students will learn how to install Python, install VS Code, set up Python extensions, configure a formatter, run their first Python program, and prepare a professional coding environment.
| Tool | Purpose |
|---|---|
| Python | The programming language we will use. |
| VS Code | The editor where we write code. |
| Python Extension | Adds Python support inside VS Code. |
| Pylance | Helps with autocomplete and code intelligence. |
| Black Formatter | Automatically cleans Python code formatting. |
Go to:
Open Python Download PageClick the yellow download button for the latest Python version.
Add Python to PATH
Click:
Install Now
Open Command Prompt or Terminal and type:
python --version
Expected output:
Python 3.x.x
During installation, select these options:
After installation, open VS Code from the Start Menu or desktop shortcut.
In VS Code, press:
Ctrl + Shift + X
Search and install these extensions:
Create a folder named:
python-practice
In VS Code:
File → Open Folder → python-practice
Create a file named:
first.py
a = 10
b = 5
c = a + b
print("a =", a)
print("b =", b)
print("c =", c)
There are three common ways to run Python code in VS Code.
Right click → Run Python File in Terminal
python first.py
Click the play/run button in the top-right corner of VS Code.
Expected output:
a = 10 b = 5 c = 15
A formatter automatically improves the spacing and structure of your code.
pip install black
black --version
In VS Code, press:
Ctrl + Shift + P
Search:
Preferences: Open User Settings JSON
Add this setting:
{
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter"
}
}
Write ugly code like this:
a=10 b=5 print( a+b )
Save the file using:
Ctrl + S
After saving, it should become:
a = 10 b = 5 print(a + b)
A virtual environment keeps each project separate. This is very important for serious Python, AI, ML, and web development.
python -m venv venv
venv\Scripts\activate
source venv/bin/activate
pip install numpy
pip freeze > requirements.txt
pip install -r requirements.txt
A formatter fixes style. A linter warns about possible mistakes.
pip install ruff
ruff check .
ruff check . --fix
Debugging means running code step by step and watching variables.
F5.Example debug code:
a = 20 b = 10 addition = a + b subtraction = a - b multiplication = a * b division = a / b print(addition) print(subtraction) print(multiplication) print(division)
A clean Python project can look like this:
my-python-project/ │ ├── venv/ ├── src/ │ └── main.py ├── tests/ │ └── test_main.py ├── requirements.txt ├── README.md └── .gitignore
| Item | Meaning |
|---|---|
| venv | Virtual environment folder |
| src | Main source code |
| tests | Test files |
| requirements.txt | List of packages |
| README.md | Project explanation |
| .gitignore | Files Git should ignore |
| Action | Shortcut |
|---|---|
| Open Command Palette | Ctrl + Shift + P |
| Open Terminal | Ctrl + ` |
| Save File | Ctrl + S |
| Run Without Debugging | Ctrl + F5 |
| Start Debugging | F5 |
| Format Document | Shift + Alt + F |
Students should take these screenshots and submit them as proof of setup. Replace each placeholder with your own uploaded image URL if using this on Blogspot.
Show the Python download button.
Show the checkbox “Add Python to PATH”.
Show terminal output of:
python --version
Show VS Code open on your computer.
Show Python, Pylance, and Black Formatter extensions.
Show first.py and terminal output.
Show code before and after formatting.
Create a file named:
calculator.py
Write this code:
a = 20
b = 10
print("Addition:", a + b)
print("Subtraction:", a - b)
print("Multiplication:", a * b)
print("Division:", a / b)
print("Floor Division:", a // b)
print("Modulus:", a % b)
print("Power:", a**b)
a and b.pip?A professional Python developer follows this workflow:
Learn how to install Python, VS Code, Python extensions, Black Formatter, virtual environment, pip, debugging, and professional Python setup from level 0.
Python VS Code Formatter Black Setup Coding Programming Python Install Editor Beginner AI ML Tools PATH Pip Extensions Debugging Code Run Lesson Champak