Privacy Notice: When you sign in with GitHub, your quiz attempts are stored in Google Firebase so you can track your progress. This data is only accessible to the course instructor, is not otherwise shared, and will be deleted at the end of the semester. For earlier deletion, contact the instructor. Prefer to stay anonymous? Use guest mode or a GitHub account without your real name.
Loading...
Sign in to track your progress and see your results across devices.
●Progress is being saved
01 Quiz: Modern Python Implementation
Score:0 / 20
Question Overview
PendingCorrectIncorrect
Instructions
This interactive quiz tests your understanding of key concepts from Chapter 01 (Modern Python Development).
Preparation: Read First
Before attempting this quiz, study the following lecture sections:
uv workflows: direct run, manual venv, named scripts
Script Python vs. Production Python
Why Take This Quiz?
For Your Learning:
Self-Assessment: Identify areas where you have strong understanding and topics that need review
Exam Preparation: The quiz format and difficulty mirror what you can expect in the final exam
Immediate Feedback: Get instant feedback on your answers to reinforce correct understanding
Active Recall: Testing yourself is one of the most effective learning techniques
Guidelines:
Each question has 4 options with exactly one correct answer
Try to answer without referring to the lecture materials first
Sign in with GitHub to save your progress across sessions
Or continue as guest (progress won’t be saved)
Scoring Guide
18-20 correct: Excellent! Strong grasp of modern Python development workflows and tooling
15-17 correct: Good understanding! Review the areas you missed, particularly the practical workflow concepts
12-14 correct: Fair understanding. Revisit the lecture sections on virtual environments, uv workflows, and pyproject.toml
Below 12: Please review the lecture carefully. Focus on understanding why modern tools exist and what problems they solve
Question1
Python's Dominance
Why is Python considered the leading language for modern software development in 2025?
✓Correct!
Correct: B)
Python dominates because it offers an exceptional combination of human-readable syntax, applicability across virtually every domain (web, data science, AI, automation, scientific computing), and the most comprehensive ecosystem for AI/ML development. While it’s not the fastest language (D is incorrect) or the oldest (A is incorrect), its productivity and versatility make it the #1 choice for modern developers. Option C is wrong because many languages can do web development.
✗Not quite.
Hint:
Think about what makes Python unique across multiple domains, not just one metric.
Question2
Virtual Environments
What fundamental problem do Python virtual environments solve?
✓Correct!
Correct: B)
Virtual environments solve the “dependency hell” problem where different projects need different versions of the same package. Without virtual environments, installing pandas 2.1.0 for Project B would overwrite pandas 1.5.0 needed by Project A, causing Project A to break. Virtual environments create isolated spaces where each project has its own dependencies. Options A, C, and D describe capabilities that virtual environments don’t provide.
✗Not quite.
Hint:
Consider what happens when two projects need different versions of the same package.
Question3
Virtual Environments
In the lecture’s apartment building analogy for virtual environments, what do the “apartments” represent?
✓Correct!
Correct: C)
The apartment building analogy illustrates how virtual environments work: each apartment (virtual environment) has its own furniture (packages), residents (projects) don’t interfere with each other, and the building (your computer) can host many independent apartments. Each virtual environment is completely isolated, just like apartments in a building.
✗Not quite.
Hint:
Each apartment is self-contained and independent from the others.
Question4
Virtual Environments
When you create a virtual environment, where are the project’s installed packages actually stored?
✓Correct!
Correct: B)
Virtual environments create a local directory structure (typically .venv/) that contains a site-packages/ folder where all the project’s dependencies are installed. This is separate from the global Python installation, which is the whole point of isolation. The packages aren’t stored in the cloud (C) or in a compressed format (D), and they’re not in the global installation (A) because that would defeat the purpose of isolation.
✗Not quite.
Hint:
Look for a local directory structure that mirrors the global Python layout.
Question5
Modern Tooling
Before modern tools like uv, how many manual steps did developers typically need to perform to set up and run a Python project with dependencies?
✓Correct!
Correct: C)
The traditional workflow required: (1) python -m venv .venv, (2) activate the environment (OS-specific command), (3) pip install --upgrade pip, (4) install all dependencies, (5) run your code, and (6) deactivate when done. This was slow, manual, and error-prone. Modern tools like uv collapsed this into a single command: uv run main.py. Option D is wrong because it was possible, just cumbersome.
✗Not quite.
Hint:
Think about all the individual commands needed: create, activate, upgrade, install, run, deactivate.
Question6
pyproject.toml
What is the primary purpose of the pyproject.toml file in modern Python projects?
✓Correct!
Correct: B)
pyproject.toml is the modern, standardized configuration file that contains everything about your project: metadata (name, version, authors), dependencies with version constraints, build system configuration, and tool settings. It replaces the fragmented old approach of having requirements.txt, setup.py, setup.cfg, and other separate files. It’s not for source code (A), version control (C), or performance optimization (D).
✗Not quite.
Hint:
It replaces multiple older configuration files with a single standardized one.
Question7
pyproject.toml
What does the version specifier pandas>=2.1.0 mean in a pyproject.toml file?
✓Correct!
Correct: B)
The >= operator means “greater than or equal to,” so pandas>=2.1.0 allows pandas 2.1.0, 2.1.1, 2.2.0, 3.0.0, or any future version. This is generally recommended because it allows bug fixes and improvements while still ensuring a minimum version. Option A would be pandas==2.1.0 (exact version), C would be pandas<=2.1.0, and D is not what this notation means.
✗Not quite.
Hint:
Focus on what the >= operator means mathematically.
Question8
Modern Tooling
What makes uv significantly faster than traditional Python package management tools like pip?
✓Correct!
Correct: B)
uv achieves 10-100x speed improvements because it’s written in Rust (compiled to native machine code, not interpreted Python), performs parallel package downloads and installations, uses optimized file I/O, and implements smart global caching. It doesn’t use quantum computing (A), downloads the same necessary packages as pip (C), and importantly does check dependencies properly – that’s part of what makes it better (D is wrong and would be dangerous).
✗Not quite.
Hint:
Consider what language uv is written in and how it handles downloads.
Question9
uv Workflows
Which uv workflow is considered the most professional approach for distributing Python applications?
✓Correct!
Correct: C)
Named scripts (like defining road-viewer = "main:main" in pyproject.toml) represent the most professional approach because they create clean, memorable CLI commands, are the standard used by professional tools (pytest, black, ruff), enable distribution through package repositories, and clearly define entry points. Option A is great for development, B is good for debugging, but C is what production-ready Python projects use. Option D is never recommended.
✗Not quite.
Hint:
Think about how professional Python tools like pytest or ruff are invoked.
Question10
uv Workflows
When you execute uv run main.py, which of the following does NOT happen?
✓Correct!
Correct: D)
uv run works entirely with project-local virtual environments and never modifies your global Python installation – that’s the whole point of the tool! It does read pyproject.toml (A), manage the .venv/ directory (B), and install dependencies locally (C), but all changes are isolated to the project. Keeping the global Python installation clean and untouched is a fundamental principle of proper Python development.
✗Not quite.
Hint:
The whole point of virtual environments is isolation from the global installation.
Question11
Professional Python
What is the PRIMARY difference between “Script Python” and “Production Python”?
✓Correct!
Correct: B)
The key difference isn’t the language (both use Python) or necessarily performance, but the engineering practices: Production Python has modular structure, proper packaging with pyproject.toml, documentation, type hints, testing, version control, and can be distributed and maintained by teams. Script Python might work for a quick task but lacks the structure needed for long-term maintenance, collaboration, and distribution.
✗Not quite.
Hint:
Focus on engineering practices and structure, not the language itself.
Question12
Modern Tooling
Which of the following represents the MODERN, recommended way to add a package to your project with uv?
✓Correct!
Correct: C)
uv add package-name is the modern, native uv command that automatically updates pyproject.toml, resolves dependencies properly, updates the lock file, and installs the package. Option A (uv pip install) exists for backward compatibility but doesn’t update pyproject.toml automatically. Option B uses pip without uv’s benefits. Option D is manual and error-prone. The lecture specifically emphasizes using native uv commands over pip-compatible ones.
✗Not quite.
Hint:
The modern command should automatically update your project configuration file.
Question13
Professional Python
The lecture has you download a zipped project file, even though Git/GitHub is better. Why this pedagogical choice?
✓Correct!
Correct: B)
The lecture deliberately uses a zip file as a teaching tool – you start with the “old way,” initialize Git yourself, create a GitHub repository, and connect/push. This hands-on experience teaches you how repositories are created from scratch, which helps you understand what’s happening “under the hood” when you clone existing repos later. It’s like learning to ride a bike with training wheels before joining the Tour de France.
✗Not quite.
Hint:
Think about why doing something the hard way first can be a better learning experience.
Question14
Python Internals
When Python looks for a package to import, in what order does it search?
✓Correct!
Correct: C)
Python searches in this specific order: (1) Current directory where you run the script, (2) Virtual environment’s site-packages/ if a venv is active, (3) System Python’s site-packages/ for global installations, (4) Standard library for built-in modules. This order is why virtual environments work – by putting their site-packages/ earlier in the search path, packages installed there are found before global ones.
✗Not quite.
Hint:
The search starts with the most local location and moves outward.
Question15
Python's Dominance
According to the lecture, which factor is NOT a primary reason for Python’s dominance?
✓Correct!
Correct: C)
Python is NOT the fastest language – compiled languages like C++ and Rust are much faster. Python dominates because of readability (A), versatility across all domains (B), and the enormous ecosystem (D), plus the AI/ML revolution where Python is the de facto standard. Python wins on developer productivity and ecosystem strength, not raw execution speed. The tradeoff is intentional: slower execution but faster development.
✗Not quite.
Hint:
Python is known for many strengths, but raw speed is not one of them.
Question16
Professional Python
In Step 3 of the setup guide, you’re asked to replace the author name in pyproject.toml with your GitHub username. Why does this matter?
✓Correct!
Correct: B)
Updating the author field teaches you about proper attribution in software development. When you publish packages or contribute to open source, correct authorship is crucial for credit, licensing, legal compliance, and professional reputation. The code will run fine without changing it (A is false), GitHub doesn’t enforce author matching (C is false), and it has clear pedagogical purpose (D is false). It’s about developing professional habits early.
✗Not quite.
Hint:
Think about why authorship matters in open source and professional software.
Question17
Modern Tooling
The lecture describes three eras of Python package management. What represents the “Modern Era”?
✓Correct!
Correct: C)
The lecture traces three eras: Ancient Times (pip + venv), Middle Ages (Poetry/Pipenv), and Modern Era (uv). The Modern Era is characterized by uv’s revolutionary speed (written in Rust), unified tooling (one tool replaces many), proper dependency resolution, automatic lock files, and smart caching. Options A and B are previous eras, and D is part of the ancient approach.
✗Not quite.
Hint:
The Modern Era is defined by a specific tool written in a compiled language.
Question18
Professional Python
When you define road-viewer = "main:main" in the [project.scripts] section, what does the syntax mean?
✓Correct!
Correct: A)
The syntax command-name = "module:function" creates a CLI command that invokes a specific function. So road-viewer = "main:main" means: when someone runs the road-viewer command, Python will import the main module (main.py) and execute its main() function. This is the professional way to create command-line tools and is used by all major Python CLI applications like pytest, black, and ruff.
✗Not quite.
Hint:
The colon separates the module name from the function name.
Question19
uv Workflows
What’s the difference between uv tool install ruff and uv add ruff?
✓Correct!
Correct: B)
uv tool install ruff installs the tool globally, making it available everywhere on your system for any project (like installing pytest, black, or other development tools you use across projects). uv add ruff adds it as a dependency of the current project and installs it in that project’s virtual environment. Both have valid use cases: global tools for development utilities, project dependencies for libraries your code imports. They’re not the same (A), neither is deprecated (C), and D is incorrect.
✗Not quite.
Hint:
One is system-wide, the other is project-specific.
Question20
Professional Python
According to the lecture introduction, what’s the main difference between “writing a script that works” and “building professional software”?
✓Correct!
Correct: B)
The lecture’s core message is that professional software engineering isn’t about making code that “just works” – it’s about creating maintainable, scalable, collaborative, properly structured, and well-tooled systems. This includes version control, proper dependencies management, testing, documentation, reproducible environments, and professional workflows. Size alone (C) doesn’t determine professionalism, scripts can be used professionally (D is too narrow), and the same languages are used (A is incorrect).
✗Not quite.
Hint:
Professional software is defined by its engineering practices, not its size or audience.