Complete the code to import the Flask module.
from [1] import Flask
The Flask module is imported using from flask import Flask.
Complete the code to create a Flask app instance.
app = [1](__name__)The Flask app instance is created by calling Flask(__name__).
Fix the error in the route decorator to serve sensor data at '/sensor'.
@app.route('[1]') def sensor_data(): return {'temperature': 22.5, 'humidity': 60}
The route must start with a slash and match the URL path exactly, so '/sensor' is correct.
Fill both blanks to return JSON response using Flask's jsonify function.
from flask import Flask, [1] @app.route('/sensor') def sensor_data(): data = {'temperature': 22.5, 'humidity': 60} return [2](data)
The jsonify function is imported and used to return JSON responses in Flask.
Fill all three blanks to run the Flask app on host '0.0.0.0' and port 5000.
if __name__ == '__main__': app.run(host=[1], port=[2], debug=[3])
To make the Flask app accessible on the network, use host '0.0.0.0', port 5000, and enable debug mode with True.
