wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ITP1 Week 14 Recap

Total questions: 15

Worksheet time: 5mins

Name
Class
Date
1.

What is the main purpose of Flask Blueprints?

a)

To increase the performance of Flask applications.

b)

To encapsulate functionality, including views, templates, and other resources.

c)

To handle database connections.

d)

To provide enhanced security features.

2.

Which of the following is NOT a typical component found in a Flask Blueprint structure?

a)

Templates

b)

JavaScript files

c)

Python files

d)

Static files

3.

What is the purpose of the url_prefix argument when registering a Blueprint in Flask?

a)

To serve static files from a specific URL.

b)

To prepend a path to all of the Blueprint’s URLs.

c)

To define the Blueprint’s name.

d)

To specify the folder containing the Blueprint’s templates.

4.

In a Flask application, what role does the init.py file typically play?

a)

It acts as the main execution script for Flask applications.

b)

It marks a directory as a Python package and initializes the application.

c)

It registers new database models.

d)

It serves as a configuration file for Flask’s logging mechanism.

5.

What is the main advantage of using Flask Blueprints?

a)

They allow for a single file application structure.

b)

They make it easier to organize and maintain large-scale applications.

c)

They provide built-in support for user authentication.

d)

They enable automatic database migrations.

6.

What is an example of a function without parameters in Flask based on the provided content?

a)

def sum(num1, num2):

b)

def Alert_Success():

c)

def total_sum(num1, num2):

d)

def create_app():

7.

What is the purpose of the requirements.txt file in a Flask project?
A. To list all Python files required by the project.

a)

To list all third-party packages and their versions required by the project.

b)

To configure the Flask server settings.

c)

To manage user roles and permissions.

d)

To list all Python files required by the project.

8.

Which Flask HTTP method is used to send data from a client to a server requesting a response body?

a)

POST

b)

GET

c)

PUT

d)

DELETE

9.

What does the function create_app() typically do in a Flask application?

a)

It starts the Flask server.

b)

It initializes the Flask application and sets up configurations.

c)

It connects to the database.

d)

It sends HTTP requests.

10.

Which of the following is a benefit of using a requirements.txt file?

a)

It automates the process of creating HTML templates.

b)

It ensures that the project uses the latest version of all packages.

c)

It simplifies dependency management and ensures reproducibility across environments.

d)

It allows Flask to automatically handle all HTTP methods.

11.

HTTPS is essentially HTTP with added encryption, using TLS (SSL) to secure data exchanges.

a)

True

b)

False

12.

Cookies are small data files stored on a user's device that can only be created by the website the user is currently visiting.

a)

True

b)

False

13.

Session cookies are deleted automatically once the browser is closed or the session becomes inactive.

a)

True

b)

False

14.

HTTPS can improve a website's search engine ranking.

a)

True

b)

False

15.

Persistent cookies are stored on a user’s device for a predetermined period and are used for long-term tracking.

a)

True

b)

False