Table of Contents
Python Project for AI & Application Development Week 01 Quiz Answers
Q1. The prefix to the filename where you write the test cases is:
- It has not prefix
Q2. The python code will throw runtime error if pylint is not run before executing the file.
Q3. In accordance with pylint which of the following is valid method name
Q4. Your code has the following method.
What will be the outcome of the test?
assertNotEqual(returnString(),”How are you”,”They are equal”)
- The test will pass.
- The test will fail.
- The code will throw runtime error as the values are not equal
- The test will not run as the method name does not qualify in static code analysis.
Q5. To package a python script in a package to be able to import and use it, which of the following is required.
- A folder with server.py
- The python script should be packaged in a directory with __init__.py in the same directory
- import sys as the first line of code in the python script.
- The methods in the script should be defined as public method
Q6. Which of the following is correct about Flask?
- It is a full-stack application framework
- It is a micro web framework
- It is a database framework
- It is an external Java framework
Q7. Which of the following methods are supported in an API endpoint created with Flask?
- Only 1 and 4
- Only 1,3 and 4
- Only 1,2 and 3
- All 4 are supported.
Q8. What is the below line of code referred to as?
- Method definition
- Route decorator
- Get Request
- Flask method
Q9. One method can have only one route decorator. True or False?
Q10. Which of the following is true about the following line of code?
- This end-point supports get requests
- This end-point supports post requests
- This end-point supports update requests
- The value of name is variable.