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.
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
python --version # Python 3.x.x
python3 --version # macOS/Linux usually needs python3Install 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.
>>> print("Hello, Python!")
Hello, Python!
>>> exit()Script Mode
Save code to a .py file and run it. This is how real programs are built.
python hello.py4. Comments
Everything after # on a line is a comment — Python ignores it completely.
# Single-line comment
print("Running!") # end-of-line commentTriple-quoted strings ("""...""") act as multi-line comments when not assigned to anything.
5. Common Mistakes
- python not found on Windows — PATH not registered. Re-run installer and check "Add Python to PATH".
- "SyntaxError: Missing parentheses" — you used Python 2 syntax. Python 3 always uses print("hello").
- print(Hello) without quotes → NameError. Strings must be in "..." or '...'.
💻 Examples
Run these examples and check the output yourself.
print("Hello, Python!")
Hello, Python!print("Name: Alice")
print("Age: 20")
print("Hobby: Coding")
Name: Alice
Age: 20
Hobby: Coding# Single-line comment
print("Hello!") # inline comment
"""
This triple-quoted string
acts as a multi-line comment.
"""
print("Done.")
Hello!
Done.📝 Exercises
Try them yourself first, then open the solution to compare.
Environment Check
Goal: Verify Python and VS Code are installed correctly.
- Run python --version (must show 3.10+)
- Install VS Code + Python extension
- Submit screenshot of running print("Hello")
- · Python 3.10+ installed — 50%
- · VS Code runs code — 50%
intro.py — Self-introduction
Goal: Print personal information using only print().
- File name: intro.py
- Print: name / age / city / favorite language
$ python intro.py
Name: Alice
Age: 20
City: Seoul
Language: Python- · All 4 items — 70%
- · Correct format — 20%
- · Correct filename — 10%
▶Toggle solution
print("Name: Alice")
print("Age: 20")
print("City: Seoul")
print("Language: Python")
Name: Alice
Age: 20
City: Seoul
Language: PythonAll lecture materials and example code are openly available on GitHub.
View on GitHub ↗