Latest 98-381 Study Guides 2021 - With Test Engine PDF
Get New 98-381 Practice Test Questions Answers
Career Opportunities
This exam paves the path to becoming a skilled Python programming specialist. After earning the respective certification, IT pros can aim at pivotal developers job roles like software programmer and web application developers. Also, due to high-end inherited skills, these individuals can expect to gain decent pay. For instance, the median salary of a software developer is about $72k per annum, according to PayScale, and this is an average sum. When it comes to web app developers, their remuneration can go up to $95 annually.
Certification Overview
Those who come up with flying colors in the Microsoft 98-381exam are going to obtain the MTA: Introduction to Programming Using Python certification. This is an entry-level certificate helping IT professionals to have an easy and early career launch.
Without demanding any specific experience prerequisites in advance, this MTA accreditation imparts the foundational yet crucial concepts of Python and makes one ready to become an essential part of the IT Infrastructure domain.
NEW QUESTION 14
You are creating a Python program that shows a congratulation message to employees on their service anniversary.
You need to calculate the number of years of service and print a congratulatory message.
You have written the following code. Line numbers are included for reference only.
You need to complete the program.
Which code should you use at line 03?
print("Congratulations on" + (int(end)-int(start)) +
- A. "years of service!")
- B. "years of service!")
print("Congratulations on" + int(end - start) + - C. "years of service!")
print("Congratulations on" + str(end - start)) + - D. "years of service!")
print("Congratulations on" + str(int(end)-int(start)) +
Answer: B
Explanation:
Explanation/Reference:
int must be converted to string
NEW QUESTION 15
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?
- A. totalItems = str(input("How many items would you like?"))
- B. totalItems = input("How many items would you like?")
- C. totalItems = float(input("How many items would you like?"))
- D. totalItems = int(input("How many items would you like?"))
Answer: B
Explanation:
References:
http://www.informit.com/articles/article.aspx?p=2150451&seqNum=6
NEW QUESTION 16
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.
Answer:
Explanation:
Explanation:
b = (-a)**2
NEW QUESTION 17
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.
Answer:
Explanation:
References:
https://www.w3resource.com/python/python-while-loop.php
NEW QUESTION 18
You are creating a function that manipulates a number. The function has the following requirements:
A floatis passed into the function
The function must take the absolute value of the float
Any decimal points after the integer must be removed
Which two math functions should you use? Each correct answer is part of the solution. (Choose two.)
- A. math.fabs(x)
- B. math.frexp(x)
- C. math.floor(x)
- D. math.ceil(x)
- E. math.fmod(x)
Answer: A,D
Explanation:
Explanation/Reference:
References: https://docs.python.org/2/library/math.html#number-theoretic-and-representation-functions
NEW QUESTION 19
This question requires that you evaluate the underlined text to determine if it is correct.
You write the following code:
The out.txt file does not exist. You run the code. The code will execute without error.
Review the underlined text. If it makes the statement correct, select "No change is needed". If the statement is incorrect, select the answer choice that makes the statement correct.
- A. The code runs, but generates a logic error
- B. The code will generate a syntax error
- C. No change is needed
- D. The code will generate a runtime error
Answer: C
Explanation:
Explanation/Reference:
References: https://docs.python.org/2/library/exceptions.html
NEW QUESTION 20
HOTSPOT
The ABC Video company needs a way to determine the cost that a customer will pay for renting a DVD. The cost is dependent on the time of day the DVD is returned. However, there are also special rates on Thursdays and Sundays. The fee structure is shown in the following list:
* The cost is $1.59 per night.
* If the DVD is returned after 8 PM, the customer will be charged an extra day.
* If the video is rented on a Sunday, the customer gets 30% off for as long as they keep the video.
* If the video is rented on a Thursday, the customer gets 50% off for as long as they keep the video.
You need to write code to meet the requirements.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Answer:
Explanation:
Explanation:
References:
https://www.w3resource.com/python/python-operators.php
https://www.w3resource.com/python/python-if-else-statements.php
NEW QUESTION 21
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. Place the notes inside of parentheses on any time
- B. Place the notes after the # sign on any line
- C. Place the notes after the last line of code separated by a blank line
- D. Place the notes before the first line of code separated by a blank line
Answer: B
Explanation:
References:
http://www.pythonforbeginners.com/comments/comments-in-python
NEW QUESTION 22
HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Answer:
Explanation:
Explanation:
References: https://docs.python.org/2.0/ref/try.html
NEW QUESTION 23
HOTSPOT
You create the following program to locate a conference room and display the room name. Line numbers are included for reference only.
Colleagues report that the program sometimes produces incorrect results.
You need to troubleshoot the program. Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
Answer:
Explanation:
References:
https://www.w3resource.com/python/python-data-type.php
https://www.w3resource.com/python/python-if-else-statements.php
NEW QUESTION 24
Evaluate the following Python arithmetic expression:
What is the result?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: A
Explanation:
Section: (none)
Explanation/Reference:
References: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
NEW QUESTION 25
You are writing a Python program to automate inventory. Your first task is to read a file of inventory transactions. The file contains sales from the previous day, including the item id, price, and quantity.
The following shows a sample of data from the file:
The code must meet the following requirements:
* Each line of the file must be read and printed
* If a blank line is encountered, it must be ignored
* When all lines have been read, the file must be closed
You create the following code. Line numbers are included for reference only.
Which code should you write for line 05 and line 06?
- A.

- B.

- C.

- D.

Answer: B
Explanation:
Explanation/Reference:
https://www.dotnetperls.com/readline-python
NEW QUESTION 26
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 ais the value that will be input and bis 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:
Answer:
Explanation:
Section: (none)
NEW QUESTION 27
The ABC company is creating a program that allows customers to log the number of miles biked. The program will send messages based on how many miles the customer logs.
You create the following Python code. Line numbers are included for reference only.
You need to define the two required functions.
Which code segments should you use for line 01 and line 04? Each correct answer presents part of the solution? (Choose two.)
- A. 04 def calc_calories(miles, burn_rate):
- B. 04 def calc_calories():
- C. 01 def get_name(name):
- D. 01 def get_name(biker):
- E. 04 def calc_calories(miles, calories_per_mile):
- F. 01 def get_name():
Answer: A,D
Explanation:
References:
https://www.w3resource.com/python/python-user-defined-functions.php
NEW QUESTION 28
HOTSPOT
The ABC organics company needs a simple program that their call center will use to enter survey data for a new coffee variety.
The program must accept input and return the average rating based on a five-star scale. The output must be rounded to two decimal places.
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.
NOTE: Each correct selection is worth one point.
Hot Area:
Answer:
Explanation:
Explanation/Reference:
References: https://www.w3resource.com/python/python-format.php#num
NEW QUESTION 29
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:
Answer:
Explanation:
Section: (none)
Explanation/Reference:
References: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
NEW QUESTION 30
HOTSPOT
You find errors while evaluating the following code. Line numbers are included for reference only.
You need to correct the code at line 03 and line 06.
How should you correct the code? Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
NOTE: Each correct selection is worth one point.
Answer:
Explanation:
References:
https://www.w3resource.com/python/python-while-loop.php
NEW QUESTION 31
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.
Answer:
Explanation:
References:
https://www.w3resource.com/python/python-data-type.php
NEW QUESTION 32
You develop a Python application for your school.
You need to read and write data to a text file. If the file does not exist, it must be created. If the file has content, the content must be removed.
Which code should you use?
- A. open("local_data", "w")
- B. open("local_data", "r")
- C. open("local_data", "r+")
- D. open("local_data", "w+")
Answer: D
Explanation:
Explanation/Reference:
Explanation:
Modes 'r+', 'w+' and 'a+' open the file for updating (reading and writing). Mode 'w+' truncates the file.
References:
https://docs.python.org/2/library/functions.html
https://pythontips.com/2014/01/15/the-open-function-explained/
NEW QUESTION 33
HOTSPOT
You are developing a Python application for an online product distribution company.
You need the program to iterate through a list of products and escape when a target product ID is found.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:
Answer:
Explanation:
Explanation/Reference:
References: https://www.w3resource.com/python/python-while-loop.php
NEW QUESTION 34
HOTSPOT
You create a function to calculate the power of a number by using Python.
You need to ensure that the function is documented with comments.
You create the following code. Line numbers are included for reference only.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:
Answer:
Explanation:
Explanation/Reference:
References:
http://www.pythonforbeginners.com/comments/comments-in-python
https://www.w3resource.com/python/python-string.php
NEW QUESTION 35
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?
- A. totalItems = input("How many items would you like?")
- B. totalItems = float(input("How many items would you like?"))
- C. totalItems = str(input("How many items would you like?"))
- D. totalItems = int(input("How many items would you like?"))
Answer: B
Explanation:
Explanation/Reference:
References: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html
NEW QUESTION 36
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. Place the notes inside of parentheses on any time
- B. Place the notes after the last line of code separated by a blank line
- C. Place the notes after the #sign on any line
- D. Place the notes before the first line of code separated by a blank line
Answer: C
Explanation:
Explanation/Reference:
References: http://www.pythonforbeginners.com/comments/comments-in-python
NEW QUESTION 37
HOTSPOT
You work for a company that distributes media for all ages.
You are writing a function that assigns a rating based on a user's 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:
Answer:
Explanation:
Explanation/Reference:
References: https://www.w3resource.com/python/python-if-else-statements.php
NEW QUESTION 38
HOTSPOT
You are an intern for ABC electric cars company. You must create a function that calculates the average velocity of their vehicles on a 1320 foot (1/4 mile) track. The output must be as precise as possible.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Answer:
Explanation:
Explanation:
References: https://www.w3resource.com/python/python-data-type.php
NEW QUESTION 39
......
98-381 Dumps and Exam Test Engine: https://www.actualpdf.com/98-381_exam-dumps.html
