Here’s a detailed Day 1 lesson plan for introducing Python and VS Code, including step-by-step installation and live coding with VS Code sharing.
Day 1: Introduction to Python & VS Code Setup
Objective:
- Understand what Python is and why it’s used.
- Install Python and VS Code.
- Write and run the first Python program in VS Code.
- Learn basic VS Code features for Python development.
1. Introduction to Python (15 mins)
Key Points:
-
What is Python?
- A high-level, interpreted programming language.
- Used for web development, data science, AI, automation, etc.
- Easy to learn, readable syntax.
-
Why Python?
- Beginner-friendly.
- Large community & libraries.
- Used by Google, NASA, Netflix, etc.
-
Python Basics:
.py files (Python scripts).
print() function.
- Comments (
# for single-line, ''' for multi-line).
Demo:
2. Installing Python & VS Code (20 mins)
Step-by-Step Installation Guide:
A. Install Python
-
Download Python from python.org
- Choose the latest Python 3.x version.
- Check "Add Python to PATH" (important!).
- Click Install Now.
-
Verify Installation
- Open Command Prompt (Windows) or Terminal (Mac/Linux).
- Type:
python --version
- Should display something like
Python 3.11.4.
B. Install VS Code
-
Download VS Code from code.visualstudio.com
- Choose the correct version for your OS (Windows, Mac, Linux).
- Run the installer and follow steps.
-
Install Python Extension in VS Code
- Open VS Code.
- Go to Extensions (Ctrl+Shift+X).
- Search for "Python" (by Microsoft).
- Click Install.
-
Set Up Python Interpreter in VS Code
- Open a folder (File > Open Folder).
- Press
Ctrl+Shift+P (Command Palette).
- Type "Python: Select Interpreter" and choose the installed Python version.
3. Writing & Running Python in VS Code (20 mins)
Live Coding Session (Share Screen with Student):
A. Create a Python File
- Open VS Code.
- Click File > New File (
Ctrl+N).
- Save as
hello.py (Ctrl+S).
B. Write & Run the First Program
- Type:
print("Hello, Python!")
- Run the Code:
- Press
F5 (Debug) or click Run > Run Without Debugging.
- Alternatively, open the Terminal (
Ctrl+~) and type:
python hello.py
C. Basic VS Code Features for Python
- Terminal: Run Python commands (
python --version).
- Debugging: Set breakpoints, step through code.
- IntelliSense: Auto-complete code suggestions.
- Extensions: Install Pylint (for code checking).
4. Hands-On Exercise (15 mins)
Task:
Expected Output:
What's your name? John
Hello, John! Welcome to Python.
5. Summary & Homework (5 mins)
Key Takeaways:
✅ Python is easy to learn and widely used.
✅ VS Code is a powerful editor for Python.
✅ We can write, run, and debug Python code in VS Code.
Homework:
- Install Python & VS Code (if not done in class).
- Write a program that asks for two numbers and prints their sum.
- Explore VS Code shortcuts (
Ctrl+S, F5, Ctrl+~).
Bonus: VS Code Shortcuts for Python
| Shortcut | Action |
|---|
Ctrl+N | New File |
Ctrl+S | Save File |
F5 | Run Debugger |
Ctrl+~ | Open Terminal |
Ctrl+Shift+P | Command Palette |
Next Class Preview:
- Day 2: Variables, Data Types, and Basic Input/Output.
Would you like me to refine any part of this lesson plan or add more details? 😊