← Back to Python series
🌱
Basic
Interpreter · Installation · REPL · Comments

Week 1 — Getting Started with Python

Learn what Python is, install Python 3.10+ and VS Code, run your first print statement, and understand the difference between REPL and script mode.

installationREPLVS CodeHello World
Duration
2 hours
Level
📊 Absolute Beginner
Prerequisite
🎯 None
OUTCOME
Run hello.py on your machine and evaluate expressions in REPL

What you'll learn

  • 1Explain the difference between a programming language and an interpreter
  • 2Install Python 3.10+ and VS Code
  • 3Write and run your first Python program
  • 4Understand the difference between REPL and script mode
  • 5Use comments to document your code

1. What is Python?

Python is an interpreted language created by Guido van Rossum in 1991. Its human-readable syntax makes it one of the best first languages to learn.

Use cases

  • Web development (Django, FastAPI)
  • Data science & ML (Pandas, PyTorch)
  • Automation & scripting
  • Games, embedded systems, education
ℹ️

Interpreted vs compiled: Python runs code line-by-line, which is great for quick experiments but slower than C/Java.

2. Setting Up Your Environment

Install Python

  • https://www.python.org/downloads/
  • Version 3.10+ recommended
  • Windows: check "Add Python to PATH"
  • macOS: brew install python also works
bash
python --version    # Python 3.x.x
python3 --version   # macOS/Linux usually needs python3

Install VS Code

  • https://code.visualstudio.com/
  • Install the "Python" extension by Microsoft

3. Your First Program — Hello, World!

REPL (Interactive Mode)

Type python in the terminal → a >>> prompt appears → enter code and see results immediately.

python
>>> print("Hello, Python!")
Hello, Python!
>>> exit()

Script Mode

Save code to a .py file and run it. This is how real programs are built.

bash
python hello.py

4. Comments

Everything after # on a line is a comment — Python ignores it completely.

python
# Single-line comment
print("Running!")    # end-of-line comment
💡

Triple-quoted strings ("""...""") act as multi-line comments when not assigned to anything.

5. Common Mistakes

  1. python not found on Windows — PATH not registered. Re-run installer and check "Add Python to PATH".
  2. "SyntaxError: Missing parentheses" — you used Python 2 syntax. Python 3 always uses print("hello").
  3. print(Hello) without quotes → NameError. Strings must be in "..." or '...'.

💻 Examples

Run these examples and check the output yourself.

01_hello.pyFirst output with print()
CODE
print("Hello, Python!")
▶ Output
Hello, Python!
02_multiple_print.pyMultiple lines of output
CODE
print("Name: Alice")
print("Age: 20")
print("Hobby: Coding")
▶ Output
Name: Alice
Age: 20
Hobby: Coding
03_comments.pyComment styles
CODE
# Single-line comment
print("Hello!")    # inline comment

"""
This triple-quoted string
acts as a multi-line comment.
"""
print("Done.")
▶ Output
Hello!
Done.

📝 Exercises

Try them yourself first, then open the solution to compare.

Exercise 1

Environment Check

Goal: Verify Python and VS Code are installed correctly.

Requirements
  • Run python --version (must show 3.10+)
  • Install VS Code + Python extension
  • Submit screenshot of running print("Hello")
Grading
  • · Python 3.10+ installed — 50%
  • · VS Code runs code — 50%
Exercise 2

intro.py — Self-introduction

Goal: Print personal information using only print().

Requirements
  • File name: intro.py
  • Print: name / age / city / favorite language
Sample I/O
$ python intro.py
Name: Alice
Age: 20
City: Seoul
Language: Python
Grading
  • · All 4 items — 70%
  • · Correct format — 20%
  • · Correct filename — 10%
Toggle solution
SOLUTION
print("Name: Alice")
print("Age: 20")
print("City: Seoul")
print("Language: Python")
▶ Output
Name: Alice
Age: 20
City: Seoul
Language: Python
Example code / lecture materials

All lecture materials and example code are openly available on GitHub.

View on GitHub ↗