Questions for the 98-381 were updated on : Sep 01 ,2024
DRAG DROP
The ABC company is converting an existing application to Python. You are creating documentation that will be used by
several interns who are working on the team.
You need to ensure that arithmetic expressions are coded correctly.
What is the correct order of operations for the six classes of operations ordered from first to last in order of precedence? To
answer, move all operations from the list of operations to the answer area and arrange them in the correct order.
Select and Place:
Explanation:
References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
HOTSPOT
You are coding a math utility by using Python.
You are writing a function to compute roots.
The function must meet the following requirements:
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
Explanation:
References:
https://www.w3resource.com/python/python-if-else-statements.php
You develop a Python application for your company.
You want to add notes to your code so other team members will understand it.
What should you do?
A
Explanation:
References:
http://www.pythonforbeginners.com/comments/comments-in-python
Evaluate the following Python arithmetic expression:
What is the result?
C
Explanation:
References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
HOTSPOT
You are developing a Python application for an online game.
You need to create a function that meets the following criteria:
The function is named update_score
The function receives the current score and a value
The function adds the value to the current score The function returns the new score
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
Explanation:
References:
https://www.w3resource.com/python/python-user-defined-functions.php
DRAG DROP
You are writing a Python program that evaluates an arithmetic formula.
The formula is described as b equals a multiplied by negative one, then raised to the second power, where a is the value that
will be input and b is the result.
You create the following code segment. Line numbers are included for reference only.
You need to ensure that the result is correct.
How should you complete the code on line 02? To answer, drag the appropriate code segment to the correct location. Each
code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll
to view content.
NOTE: Each correct selection is worth one point.
Select and Place:
DRAG DROP
The ABC company is converting an existing application to Python. You are creating documentation that will be used by
several interns who are working on the team.
You need to ensure that arithmetic expressions are coded correctly.
What is the correct order of operations for the six classes of operations ordered from first to last in order of precedence? To
answer, move all operations from the list of operations to the answer area and arrange them in the correct order.
Select and Place:
Explanation:
References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
DRAG DROP
You are creating a Python script to evaluate input and check for upper and lower case.
Which four code segments should you use to develop the solution? To answer, move the appropriate code segment from the
list of code segments to the answer area and arrange them in the correct order.
Select and Place:
Explanation:
References:
https://www.w3resource.com/python/python-while-loop.php
The ABC company has hired you as an intern on the coding team that creates e-commerce applications.
You must write a script that asks the user for a value. The value must be used as a whole number in a calculation, even if
the user enters a decimal value.
You need to write the code to meet the requirements.
Which code segment should you use?
B
Explanation:
References:
http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html
DRAG DROP
You are writing a function that works with files.
You need to ensure that the function returns None if the file does not exist. If the file does exist, the function must return the
first line.
You write the following code:
In which order should you arrange the code segments to complete the function? To answer, move all code segments from
the list of code segments to the answer area and arrange them in the correct order.
Select and Place:
Explanation:
References:
http://effbot.org/zone/python-with-statement.htm
HOTSPOT
You work for a company that distributes media for all ages.
You are writing a function that assigns a rating based on a users age. The function must meet the following requirements:
Anyone 18 years old or older receives a rating of A
Anyone 13 or older, but younger than 18, receives a rating of T
Anyone 12 years old or younger receives a rating of C If the age is unknown, the rating is set to C
You need to complete the code to meet the requirements.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
Explanation:
References:
https://www.w3resource.com/python/python-if-else-statements.php
HOTSPOT
You develop a Python application for your company.
You have the following code. Line numbers are included for reference only.
Use the drop-down menus to select the answer choice that answers each question based on the information presented in
the code segment.
Hot Area:
Explanation:
References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
http://interactivepython.org/runestone/static/pythonds/BasicDS/InfixPrefixandPostfixExpressions.html
DRAG DROP
Match the data type to the type operations.
To answer, drag the appropriate data type to the correct type operation. Each data type may be used once, more than once,
or not at all.
Select and Place:
Explanation:
References:
https://www.w3resource.com/python/python-data-type.php
HOTSPOT
During school holidays, you volunteer to explain some basic programming concepts to younger siblings.
You want to introduce the concept of data types in Python. You create the following three code segments:
You need to evaluate the code segments.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:
Explanation:
Code Segment 1: You cannot convert str to int. x1 = 2 is a string. Therefore code will produce an error. Code Segment
2: b = 1.5, which is a float.
Code Segment 3: c = 2.5, which is a float, not an int.
References:
https://www.w3resource.com/python/python-data-type.php
You are writing an application that uses the sqrt function. The program must reference the function using the name
squareRoot.
You need to import the function.
Which code segment should you use?
C
Explanation:
References:
https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html