Flask MCQ Questions & Answers
Flask MCQs : This section focuses on "Flask" of Python Frameworks. These Multiple Choice Questions (MCQ) should be practiced to improve the Flask skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Flask is a web development framework created in ___________ language.
A. C
B. Java
C. Python
D. Javascript
View Answer
Ans : C
Explanation: Flask is a web development framework created in Python language.
2. Is the Flask framework open source?
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: Yes, the Flask framework is open-source.
3. It is released under the ___________ Clause.
A. BSD-0
B. BSD-1
C. BSD-2
D. BSD-3
View Answer
Ans : D
Explanation: It is released under the BSD-3 Clause New or Revised License.
4. How to add the mailing feature in the Flask Application?
A. pip install Flask
B. pip install Flask-Mail
C. install Flask-Mail
D. pip Flask-Mail
View Answer
Ans : B
Explanation: To send emails, we need to install the Flask-Mail flask extension : pip install Flask-Mail
5. WSGI stands for the?
A. Write Server Gateway Interface
B. Web Static Gateway Interface
C. Web Server Gateway Interface
D. Web Server Gateway Interact
View Answer
Ans : C
Explanation: WSGI stands for the Web Server Gateway Interface.
6. Flask default port is?
A. 2000
B. 3000
C. 4000
D. 5000
View Answer
Ans : D
Explanation: Flask default port is 5000.
7. Flask default host is a localhost (127.0.0.1)
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, Flask default host is a localhost (127.0.0.1).
8. Flask is called a?
A. miniframework
B. microframework
C. peraframework
D. nanoframework
View Answer
Ans : B
Explanation: Flask is called a microframework because Flask only provides core features such as request, routing, and blueprints.
9. Which of the following are the benefits of using the Flask framework?
A. It has an inbuilt development server.
B. It has vast third-party extensions.
C. It is WSGI compliant.
D. All of the above
View Answer
Ans : D
Explanation: All of the above are the benefits of using the Flask framework.
10. Flask works with most of the RDBMSs, such as?
A. PostgreSQL
B. SQLite
C. MySQL
D. All of the above
View Answer
Ans : D
Explanation: Flask works with most of the RDBMSs, such as PostgreSQL, SQLite, and MySQL. However, to connect with databases, we must make use of the Flask-SQLAlchemy extension.
11. ______________ is used as a global namespace for holding any data during the application context.
A. Flask a object
B. Flask f object
C. Flask g object
D. Flask q object
View Answer
Ans : C
Explanation: Flask’s g object is used as a global namespace for holding any data during the application context. g object is not appropriate for storing the data between requests. The letter g, in a sense, stands for global.
12. Forms in Flask can be implemented by using an extension called ?
A. Flask-ATF
B. Flask-WTF
C. Flask-GTM
D. Flask-ZIP
View Answer
Ans : B
Explanation: Forms in Flask can be implemented by using an extension called Flask-WTF.
13. The __________ decorator in Flask is used to bind URL to a function.
A. route()
B. rend()
C. read()
D. write()
View Answer
Ans : A
Explanation: The route() decorator in Flask is used to bind URL to a function.
14. Which function takes up the floating point number as argument?
A. reverse()
B. show_blog()
C. route()
D. revision()
View Answer
Ans : D
Explanation: The revision() function takes up the floating point number as argument.
15. Armin Ronacher created the Flask framework.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, Armin Ronacher created the Flask framework. Flask was born out of April fool Joke in 2011.
16. The _________ method of request.cookies attribute is used to read a cookie.
A. read()
B. get()
C. set()
D. find()
View Answer
Ans : B
Explanation: The get() method of request.cookies attribute is used to read a cookie.
17. We can create an Admin interface in Flask using the Flask-Admin extension.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, We can create an Admin interface in Flask using the Flask-Admin extension.
18. To release a session variable use __________ method.
A. go()
B. pull()
C. pop()
D. explode()
View Answer
Ans : C
Explanation: To release a session variable use pop() method.
19. To integrate with Flask, we can make use of a Flask extension called Flask-Social.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, To integrate with Flask, we can make use of a Flask extension called Flask-Social.
20. Which of the following provides SMTP interface to Flask application?
A. Flask Sijax
B. Flask SQLAlchemy
C. Flask WTF
D. Flask Mail
View Answer
Ans : D
Explanation: Flask Mail : provides SMTP interface to Flask application
Discussion