🌍 All Study Guides📊 Dashboard📰 Blog💡 About
IBM Applied AI to IBM AI Developer Professional Certificate • STUDY MODE

PRACTICE QUIZ

QUESTION 1 OF 35

Identify the file where you add code to reference the modules in the package? Explanation! You will need to add code to reference the modules in the package in the __init__.py file.

A
myproject.py
B
__main__.py
C
__init__.pyCorrect Answer
D
__name__.py
QUESTION 2 OF 35

Which of the following is a best practice when creating function names to write test cases? Explanation! The unittest library identifies only the functions with the prefix ‘test’ as the functions for conducting unit tests.

A
testCorrect Answer
B
_test
C
function.test
D
Function
QUESTION 3 OF 35

Which of the following is a valid method name based on PEP8 guidelines? Explanation! According to the PEP8 guidelines, the method name should preferably be lowercase, with underscores separating the words.

A
GetUserName()
B
get_user_name()Correct Answer
C
GET_USER_NAME()
D
getUserName()
QUESTION 4 OF 35

Which of the following is required to package a Python module? Explanation! Package requires referencing to all its modules in __inti__.py. Without this, the package is not callable.

A
import sys as the first line of code in the Python script
B
A folder with server.py
C
The methods in the Python module should be defined as public methods
D
The Python module should be packaged in a directory with __init__.py in the same directoryCorrect Answer
QUESTION 5 OF 35

Which of the following is TRUE about web apps and APIs? (Select two) Explanation! Both web apps and APIs create links between two system parts. Explanation! All web apps are APIs, but not all APIs are web apps.

A
All APIs allow users to access apps without installing them on their local systems.
B
Web apps is a generic term that includes “online” or web-based and “offline” apps.
C
Both web apps and APIs link two system parts.Correct Answer
D
All web apps are APIs, but not all APIs are web apps.Correct Answer
QUESTION 6 OF 35

Which of the following statements are true about web apps? (Select two) Explanation! All web apps are APIs. Explanation! Web apps support CRUD actions.

A
Web apps help link offline apps.
B
All web apps are APIs.Correct Answer
C
Web apps is a more generic term given to all forms of apps that create a link between any two parts of a system.
D
Web apps support CRUD actions.Correct Answer
QUESTION 7 OF 35

In which testing phase do you verify that the application functions within the larger framework? Explanation! Integration tests verify that all involved programs continue functioning as expected after integration. Integration testing also verifies that the application functions within a larger framework.

A
Integration testingCorrect Answer
B
Performance testing
C
User testing
D
Unit testing
QUESTION 8 OF 35

Which of the following statements is TRUE about PyLint? Explanation! PyLint is a Python static code analysis tool. You can use the PyLint library to check the compliance of your Python code with PEP8 guidelines.

A
PyLint is a Python static code analysis tool.Correct Answer
B
PyLint is a Python code compiler.
C
PyLint is a Python IDE.
D
PyLint is a Python-based package creation tool.
QUESTION 9 OF 35

Which of the following is the right way to name constants based on the PEP8 guidelines? Explanation! The right way to name constants based on the PEP8 guidelines is DATE_OF_BIRTH.

A
DATE_OF_BIRTHCorrect Answer
B
Date_Of_Birth
C
date_of_birth
D
dateOfBirth
QUESTION 10 OF 35

When gathering requirements for an app to manage events, the customer mentions that the project’s objective is to improve customer retention. Which of the following requirements describes the above scenario? Explanation! The statement describes a business requirement. A business requirement provides a high-level description of the business need for the app or project.

A
Technical requirements
B
Constraints
C
User requirements
D
Business requirementsCorrect Answer
QUESTION 11 OF 35

Why is it a good practice to build a unit testing class? Explanation! It is a good practice to build a unit testing class as it allows you to call the unit tests from a single class object

A
To add one or more assertion methods
B
To import the unittest library
C
To check if functions are returning the correct values
D
To call unit tests from a single class objectCorrect Answer
QUESTION 12 OF 35

For this question, review the partial module code and the unit test code: ( Image S2Q7 ) When the unit test is executed, the test fails. Which of the following code statement will you modify for the unit test to pass? Explanation! The values in the assertEqual () function are incorrect. The assertEqual () function checks if the provided values are the same.

A
self. assertEqual (subract (6, 4), 3)Correct Answer
B
self. assertEqual (add (6, 4), 10)
C
def test_subract(self)
D
from math import add
QUESTION 13 OF 35

Consider the following code in the file my_code.py a directory named mypackage with __init__.py. def print_hello(): print("Hello") Which of the following two statements are the right ways to access the function in the method? print_hello () print_hello () my_code.print_hello () (CORRECT) print_hello () (CORRECT) Explanation! The function needs to be called from the file and the file from the package. Explanation! The function must be called from the file, and the file must be called from the package.

A
import my_code
B
from mypackage import print_hello
C
from mypackage import my_code
D
from mypackage.my_code import print_hello
QUESTION 14 OF 35

Which of the following is the general structure for testing a package? Explanation! The general structure for testing your package is {package_name}. {module_name}. {function_name} (parameters)

A
import {package_name}
B
run {package_name}. {module_name}. {function_name} (parameters)
C
{package_name}. {module_name}. {function_name} (parameters)Correct Answer
D
{package_name} (parameters)
QUESTION 15 OF 35

Which of the following is the correct folder structure for the package “MyPackage”? Explanation! The module files are stored in the package folder along with a __init__.py file, which imports all modules.

A
MyPackage -> module_1-> module_1.py MyPackage -> module_2-> module_2.py
B
MyPackage -> module_1.py, module_2.py, __init__.pyCorrect Answer
C
MyPackage -> module_1.py, module_2.py
D
MyPackage -> module_1.py, module_2.py, init.py
QUESTION 16 OF 35

Watson Assistant is a useful service for the creation of chatbots.

A
TrueCorrect Answer
B
False
QUESTION 17 OF 35

Which of the following dialog nodes are created for us when we start a chatbot? (Select all that apply)

A
WelcomeCorrect Answer
B
Chitchat
C
Anything elseCorrect Answer
D
Greetings
Explanation:

The Welcome node will created by default for us. Explanation: The Anything else node will created by default for us

QUESTION 18 OF 35

You cannot integrate Watson services.

A
True
B
FalseCorrect Answer
QUESTION 19 OF 35

This course will teach you about Watson Speech APIs and how to integrate them with chatbots.

A
TrueCorrect Answer
B
False
QUESTION 20 OF 35

You cannot deploy chatbots to Facebook and Slack, only to WordPress.

A
True
B
FalseCorrect Answer
QUESTION 21 OF 35

Identify the file where you add code to reference the modules in the package? 

A
myproject.py
B
__main__.py
C
__init__.pyCorrect Answer
D
__name__.py
QUESTION 22 OF 35

Which of the following is a best practice when creating function names to write test cases?

A
testCorrect Answer
B
_test
C
function.test
D
Function
QUESTION 23 OF 35

Which of the following is a valid method name based on PEP8 guidelines?

A
GetUserName()
B
get_user_name()Correct Answer
QUESTION 24 OF 35

Which of the following is required to package a Python module?

A
import sys as the first line of code in the Python script
B
A folder with server.py
C
The methods in the Python module should be defined as public methods
D
The Python module should be packaged in a directory with __init__.py in the same directoryCorrect Answer
QUESTION 25 OF 35

Which of the following is TRUE about web apps and APIs? (Select two)

A
All APIs allow users to access apps without installing them on their local systems.
B
Web apps is a generic term that includes “online” or web-based and “offline” apps.
C
Both web apps and APIs link two system parts.Correct Answer
D
All web apps are APIs, but not all APIs are web apps.Correct Answer
QUESTION 26 OF 35

Which of the following statements are true about web apps? (Select two)

A
Web apps help link offline apps.
B
All web apps are APIs.Correct Answer
C
Web apps is a more generic term given to all forms of apps that create a link between any two parts of a system.
D
Web apps support CRUD actions.Correct Answer
QUESTION 27 OF 35

In which testing phase do you verify that the application functions within the larger framework?

A
Integration testingCorrect Answer
B
Performance testing
C
User testing 
D
Unit testing
QUESTION 28 OF 35

Which of the following statements is TRUE about PyLint?

A
PyLint is a Python static code analysis tool.Correct Answer
B
PyLint is a Python code compiler.
C
PyLint is a Python IDE.
D
PyLint is a Python-based package creation tool.
QUESTION 29 OF 35

Which of the following is the right way to name constants based on the PEP8 guidelines?

A
DATE_OF_BIRTHCorrect Answer
B
dateOfBirth
QUESTION 30 OF 35

When gathering requirements for an app to manage events, the customer mentions that the project’s objective is to improve customer retention.

A
Technical requirements
B
Constraints
C
User requirements
D
Business requirementsCorrect Answer
QUESTION 31 OF 35

Why is it a good practice to build a unit testing class?

A
To add one or more assertion methods 
B
To import the unittest library
C
To check if functions are returning the correct values
D
To call unit tests from a single class objectCorrect Answer
QUESTION 32 OF 35

For this question, review the partial module code and the unit test code:

A
self. assertEqual (subract (6, 4), 3)Correct Answer
B
self. assertEqual (add (6, 4), 10)
C
def test_subract(self)
D
from math import add
QUESTION 33 OF 35

Consider the following code in the file my_code.py a directory named mypackage with __init__.py.

A
import my_code
B
print_hello ()
C
from mypackage import print_hello
D
from mypackage import my_code
E
my_code.print_hello ()Correct Answer
F
from mypackage.my_code import print_hello
QUESTION 34 OF 35

Which of the following is the general structure for testing a package?

A
import {package_name}
B
run {package_name}. {module_name}. {function_name} (parameters)
C
{package_name}. {module_name}. {function_name} (parameters)Correct Answer
D
{package_name} (parameters)
QUESTION 35 OF 35

Which of the following is the correct folder structure for the package “MyPackage”?

A
MyPackage -> module_1-> module_1.py MyPackage -> module_2-> module_2.py
B
MyPackage -> module_1.py, module_2.py, __init__.pyCorrect Answer
C
MyPackage -> module_1.py, module_2.py
D
MyPackage -> module_1.py, module_2.py, init.py
E
Google Advanced Data Analytics
F
Google Cybersecurity Professional Certificate
G
Meta Marketing Analytics Professional Certificate
H
Google Digital Marketing & E-commerce Professional Certificate
I
Google UX Design Professional Certificate
J
Meta Social Media Marketing Professional Certificate
K
Google Project Management Professional Certificate
L
Meta Front-End Developer Professional Certificate

Ready to test your recall?

Identify the file where you add code to reference the modules in the package? Explanation! You will need to add code to reference the modules in the package in the __init__.py file.

A
myproject.py
B
__main__.py
C
__init__.py
D
__name__.py

How confident are you in this answer?