Sunday, 17 May 2020

AsCEnD Python Web with Flask

Python Web with Flask Assessment


 Q1. Which WSGI library implements requests and response objects in in Flask?

Answer: Werkzeug

Q2. Which HTTP methods are provided by Flask?

Answer: GET, PUT, POST

Q3. ________ is the default port number in which a Flask application runs on localhost.

Answer: 5000

Q4. Identify the correct syntax to install virtual environment in Python?

Answer: pip install virtualenv

Q5. Which function of the Flask class is used to tell the application which URL should call the which function?

Answer: route()

Q6. Output of the command: pip list

Answer: All of these

Q7. What is the correct syntax to inherit a html page from a base html page with name base.html using jinja template?

Answer: {% extends "base.html" %}

Q8. Match the following delimiters which their use for Jinja templates.

i. {% ... %} a. Comments not included in the template output
ii. {{ ... }} b. Statements
iii. {# ... #} c. Expressions to print to the template output
iv. # ...## d. Line Statements

Answer:  i      b
               ii     c
              iii     a
              iv     d

Q9. Which of the below concept is applied to differentiate in any web application to output on the web page?

Answer: decorator

Q10. Let's assume that there is an object / instance(of Flask class ) named as ins , created in an web application. Which of the below statement you need to write in the wep application project to start executing the project?

Answer: run()

Q11. While running your Flask app during the development, you run it as app.run(). However, you are facing a little inconvenience as everytime you change something in the code, you have to stop the server and run it again. What can be done so that you need not restart the server to detect the changes in the code?

Answer: AUTOLOAD mode can be set as TRUE

Q12. POST method is used to send HTML form data to server in an unencrypted format

Answer: FALSE

Q13. @Flask Instance.route('/Reports")
If i want to display output (of the function linked to the above decorator) What is the URL i need to type in the browser to run the application Assume the app Tunning on 127.0.0.1 under port 5500

Answer: 127.0.0.1:5500/Reports

Q14. Which flask library needs to be imported to return a template as the response object

Answer: render_template

Q15. ObjectInstance = Flask(_name_)
In the above snippet, What does the _name_ refers to?

Answer: name of the current module / App to record

No comments:

Post a Comment