Flask is a lightweight web framework for Python. It helps you build web apps easily by providing tools and features without much setup.
Click to reveal answer
beginner
Why is Flask called a 'micro' framework?
Flask is called a micro framework because it keeps things simple and small. It gives you the basics to build web apps but lets you add extra features as you need.
Click to reveal answer
beginner
Which language do you use with Flask?
You use Python to write web applications with Flask.
Click to reveal answer
beginner
Name one key feature of Flask.
Flask has a built-in development server that helps you test your app quickly.
Click to reveal answer
beginner
How does Flask help beginners?
Flask is easy to learn because it has simple code and clear structure. It lets beginners build web apps step-by-step.
Click to reveal answer
What type of framework is Flask?
AMicro web framework
BFull-stack framework
CMobile app framework
DGame development framework
✗ Incorrect
Flask is a micro web framework, meaning it provides the basics for web apps without extra features by default.
Which programming language is Flask built for?
AJava
BJavaScript
CPython
DRuby
✗ Incorrect
Flask is a Python web framework.
What is a key benefit of Flask for beginners?
AComplex setup
BHeavyweight features
CRequires no coding
DSimple and easy to learn
✗ Incorrect
Flask is simple and easy to learn, making it great for beginners.
Flask is best described as:
AA lightweight web framework
BA tool to build desktop apps
CA database system
DA cloud hosting service
✗ Incorrect
Flask is a lightweight web framework for building web applications.
Which feature does Flask include by default?
ADrag and drop UI builder
BBuilt-in development server
CAutomatic database migrations
DMobile app deployment
✗ Incorrect
Flask includes a built-in development server to help test apps during development.
Explain what Flask is and why it is useful for building web applications.
Think about how Flask helps you start web projects with simple tools.
You got /4 concepts.
Describe one main feature of Flask that helps developers during app development.
Consider what makes testing your app easier in Flask.
You got /3 concepts.
Practice
(1/5)
1. What is Flask primarily used for?
easy
A. Creating desktop applications
B. Building web applications with Python
C. Managing databases directly
D. Designing mobile apps
Solution
Step 1: Understand Flask's purpose
Flask is a tool that helps developers create web applications using Python.
Step 2: Compare options with Flask's role
Options A, C, and D describe other types of software development, not Flask's main use.
Final Answer:
Building web applications with Python -> Option B
Quick Check:
Flask = Web apps with Python [OK]
Hint: Flask = Python + web apps, not desktop or mobile [OK]
Common Mistakes:
Thinking Flask is for desktop apps
Confusing Flask with database tools
Assuming Flask builds mobile apps
2. Which of the following is the correct way to start a basic Flask app?
easy
A. from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return 'Hello, Flask!'
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return 'Hello, Flask!' correctly imports Flask and creates an app with Flask(__name__). Others have wrong imports or app creation.
Step 2: Verify route and return statement
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return 'Hello, Flask!' uses @app.route('/') and returns a string, which is correct Flask syntax.
Final Answer:
Correct Flask app start code -> Option A
Quick Check:
Correct import and route = from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return 'Hello, Flask!' [OK]
Hint: Import Flask and create app with Flask(__name__) [OK]
Common Mistakes:
Using wrong import statements
Calling flask() instead of Flask()
Printing instead of returning response
3. What will this Flask route return when accessed?
from flask import Flask
app = Flask(__name__)
@app.route('/greet')
def greet():
return 'Welcome to Flask!'
medium
A. Nothing, the route is not defined
B. A syntax error because of missing parentheses
C. A server error due to missing return statement
D. A web page showing 'Welcome to Flask!'
Solution
Step 1: Analyze the route definition
The route '/greet' is defined with a function that returns the string 'Welcome to Flask!'.
Step 2: Understand Flask response behavior
Flask sends the returned string as the response body, so visiting '/greet' shows that message.
Final Answer:
A web page showing 'Welcome to Flask!' -> Option D
Quick Check:
Route returns string response = A web page showing 'Welcome to Flask!' [OK]
Hint: Returned string is sent as web page content [OK]