0% found this document useful (0 votes)
17 views5 pages

Flask Viva

Uploaded by

nish630174
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

Flask Viva

Uploaded by

nish630174
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1. What is HTML?

HTML stands for Hyper Text Mark-up Language. It is a language of World Wide
Web. It is a standard text formatting language which is used to create and display
pages on the Web. It makes the text more interactive and dynamic. It can turn text into
images, tables, and links.

2. What are Tags?

HTML tags are composed of three things: an opening tag, content and ending tag.
Some tags are unclosed tags. HTML documents contain two things:
a) content
b) tags

3. How many types of heading does an HTML contain?

The HTML contains six types of headings which are defined with the <h1> to <h6>
tags. Each type of heading tag displays different text size from another. So, <h1> is
the largest heading tag and <h6> is the smallest one.

4. What is formatting in HTML?

The HTML formatting is a process of format the text for a better look and feel. It uses
different tags to make text bold, italicized, and underlined.

5. What is the difference between HTML elements and tags?

HTML elements communicate to the browser to render text. When the elements are
enclosed by brackets <>, they form HTML tags. Most of the time, tags come in a pair
and surround content.

6. What is Flask?
Flask is a micro web framework that provides an API to build up web
applications. Flask’s framework is also easier to learn because of its diversified
working style.
Flask is based on the WSGI (Web Server Gateway Interface) toolkit and the
Jinja2 template engine. It is very flexible to implement a simple web application.
Also, Flask provides visual debugging, which gives more control over the
component.

7. Why do we use Flask (__name__) in Flask?


a. The __name__ parameter is a Python built-in variable that is set to the name
of the current module. When we pass __name__ as an argument to the Flask
class constructor, it helps Flask to determine where to locate resources such
as templates and static files.

8. What is routing in Flask?


a. App Routing means mapping the URLs to a specific function that will handle
the logic for that URL. Modern web frameworks use more meaningful URLs
to help users remember the URLs and make navigation simpler.
b. So if our site’s domain was www.example.org and we want to add routing to
“www.example.org/hello”, we would use “/hello”.

9. Who created Flask?


Armin Ronacher created the Flask framework. Flask was born out of April
fool Joke in 2011.

10. Why do we use Flask?


Flask is used to create Web applications using Python programming language.
Flask is a micro framework that is also used for quick prototyping web and
networking based applications.

11. What is the default host port and port of Flask?


Flask default host is a local host (127.0.0.1), and the default port is 5000.

12. Why Flask is called a Micro framework?


Flask is called a micro framework because Flask only provides core features such as
request, routing, and blueprints. For other features, such as Caching, ORM, forms,
etc., we need to make use of Flask-Extensions.

13. How to use the Flask commands?


As a result of the Flask installation, we also get access to a command-line application
called Flask. There are various commands that we can use.
Use Flask –help on the command line to see all the options. Default commands are
routes, run, and shell. This utility provides commands from Flask, extensions, and the
application.

14. How to create an Admin interface in Flask?


We can create an Admin interface in Flask using the Flask-Admin extension. It helps
in grouping individual views together in classes. We can use the Flask-Appbuilder
extension too. Flask-Appbuilder already comes with an Admin interface.

15. Describe the features of Forms extension for Flask.


Forms in Flask can be implemented by using an extension called Flask-WTF. Flask-
WTF is created by integrating Flask with WT Forms. WT Forms is a python-based
form rendering and validation library. It supports data validation, internationalization,
and CSRF protection.
Flask-WTF also provides reCAPTCHA support along with file uploads when tied
with Flask-Uploads. You also can handle JavaScript requests, and customize the error
response.

16. What is a chat bot?


A chat bot is a computer program that is designed to simulate a conversation with a
human user. Chat bots are used in a variety of applications, including customer
service, marketing, and even online education.

17. Which extension is used to connect to a database in Flask?


Answer: Extension enhances database management and interaction during
development by eliminating the requirement to write raw SQL queries. Postgre
SQL, SQLite, and MySQL are just a few of the RDBMSs Flask supports. The Flask-
SQLAlchemy plugin is required to connect to databases.

18. What is PYTHONPATH?


PYTHONPATH serves as an environment variable within the Python programming
language, empowering users to define supplementary directories for Python to search
when seeking modules and packages. This variable serves as a search path and helps
Python locate the necessary files to import when executing code. By setting the
PYTHONPATH variable, users can extend the default search path and customize the
module search behaviour according to their needs. This feature enables developers to
organize and structure their Python projects efficiently, facilitating easier module
importation and enhancing code reusability.

19. What are Python Modules?


Files containing Python codes are referred to as Python modules. This code can be of
different types like classes, functions, or variables. This saves the programmer’s time
by providing predefined functionalities when needed. It is a file with “.py” extension
containing an executable code.
Commonly used built modules are listed below:
1) OS
2) sys
3) data time
4) math
5) random
6) JSON
20. What are the common built-in data types in Python?
Python supports the below-mentioned built-in data types:
Immutable data types:
1) Number
2) String
3) Tuple
4) Mutable data types:
5) List
6) Dictionary
7) set

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy