Recall & Review
beginner
What is routing in Flask?
Routing in Flask is the process of matching a URL to a function that handles the request and returns a response. It connects web addresses to Python code.
Click to reveal answer
beginner
Why is routing considered the core of Flask?
Routing is core because it directs user requests to the right code. Without routing, Flask wouldn't know what to do when someone visits a web address.
Click to reveal answer
beginner
How does Flask define routes in code?
Flask uses decorators like @app.route('/path') above a function to link a URL path to that function.
Click to reveal answer
beginner
What happens if a route is not defined for a URL in Flask?
Flask returns a 404 error, meaning the page or resource was not found because no route matches the URL.
Click to reveal answer
intermediate
How does routing help organize a Flask web app?
Routing helps organize by clearly linking URLs to specific functions, making the app easier to understand and maintain.
Click to reveal answer
What does the @app.route decorator do in Flask?
✗ Incorrect
The @app.route decorator tells Flask which URL should trigger the decorated function.
What response does Flask give if no route matches a URL?
✗ Incorrect
If Flask can't find a matching route, it returns a 404 Not Found error.
Why is routing important in Flask?
✗ Incorrect
Routing connects web addresses to the functions that handle them.
Which of these is a valid Flask route definition?
✗ Incorrect
Flask uses the @app.route decorator to define routes.
What would happen if Flask had no routing system?
✗ Incorrect
Without routing, Flask can't match URLs to code, so it can't respond properly.
Explain in your own words why routing is the core of Flask.
Think about how a website knows what to show when you visit a link.
You got /3 concepts.
Describe how you would create a new route in a Flask app.
Remember the special symbol @ before route.
You got /3 concepts.