Complete the code to import the Flask class correctly.
from flask import [1] app = [1](__name__)
The Flask class is imported from the flask package using from flask import Flask.
Complete the code to define a Flask CLI command using the decorator.
@app.cli.[1]('hello') def hello_command(): print('Hello from CLI!')
The @app.cli.command decorator defines a CLI command in Flask.
Fix the error in the command function to accept a parameter.
@app.cli.command('greet') def greet_command(name): print(f'Hello, [1]!')
The function parameter is named 'name', so use it inside the print statement.
Fill both blanks to create a CLI command that takes an argument and prints it.
@app.cli.command('[1]') def echo_command(text): print(f'You said: [2]')
The command name is 'echo' and the variable used inside the print is 'text'.
Fill all three blanks to define a CLI command with an option and print the option value.
import click @app.cli.command('repeat') @click.option('--count', default=1, help='Number of repeats') def repeat_command(count): for _ in range([1]): print('[2]' * [3])
The loop runs 'count' times, printing 'Repeat!' repeated 'count' times each loop.
