Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is Flask?
A. A micro web framework for Python
B. A full-stack framework
C. A database ORM
D. A templating engine
Direction: Choose the correct option

Q2.

How do you create a Flask application instance?
A. app = Flask(__name__)
B. app = Flask()
C. app = create_app()
D. app = new Flask()
Direction: Choose the correct option

Q3.

What decorator is used to define a route?
A. @route('/')
B. @app.route('/')
C. @app.route('/')
D. @app.endpoint('/')
Direction: Choose the correct option

Q4.

What does `return 'Hello'` in a view function do?
A. Sends 'Hello' as response
B. Prints to console
C. Renders a template
D. Redirects
Direction: Choose the correct option

Q5.

How do you run a Flask development server?
A. app.start()
B. Both A and B
C. app.run()
D. flask run
Direction: Choose the correct option

Q6.

What is the purpose of `render_template()`?
A. Redirects to another page
B. Returns a string
C. Renders an HTML template
D. Sends JSON
Direction: Choose the correct option

Q7.

How do you access GET parameters in Flask?
A. request.params
B. request.data
C. request.args.get('key')
D. request.form.get('key')
Direction: Choose the correct option

Q8.

How do you access POST form data?
A. request.args.get('key')
B. request.json
C. request.data
D. request.form.get('key')
Direction: Choose the correct option

Q9.

What does `@app.route('/post/')` do?
A. Accepts integer id as a variable part of the URL
B. Accepts any id
C. Accepts string id
Direction: Choose the correct option

Q10.

How do you set the debug mode in Flask?
A. app.run(debug=True)
B. Set environment variable FLASK_DEBUG=1
C. app.debug = True
D. All of the above