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