98-381 Exam Questions Get Updated [2022] with Correct Answers
Practice 98-381 Questions With Certification guide Q&A from Training Expert Exam4Labs
NEW QUESTION 10
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:
b = (-a)**2
NEW QUESTION 11
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. 01 def get_name(biker):
- B. 04 def calc_calories(miles, calories_per_mile):
- C. 01 def get_name():
- D. 04 def calc_calories(miles, burn_rate):
- E. 01 def get_name(name):
- F. 04 def calc_calories():
Answer: A,D
Explanation:
References: https://www.w3resource.com/python/python-user-defined-functions.php
NEW QUESTION 12
DRAG DROP
You are building a Python program that displays all of the prime numbers from 2 to 100.
How should you complete the code? To answer, drag the appropriate code segments 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:
Explanation/Reference:
References:
https://docs.python.org/3.1/tutorial/inputoutput.html
https://stackoverflow.com/questions/11619942/print-series-of-prime-numbers-in-python
https://www.programiz.com/python-programming/examples/prime-number-intervals
NEW QUESTION 13
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.
Answer:
Explanation:
References:
https://www.w3resource.com/python/python-format.php#num
NEW QUESTION 14
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", "r+")
- B. open("local_data", "w+")
- C. open("local_data", "w")
- D. open("local_data", "r")
Answer: A
Explanation:
Section: (none)
Explanation/Reference:
References: https://pythontips.com/2014/01/15/the-open-function-explained/
NEW QUESTION 15
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.
Hot Area:
Answer:
Explanation:
Explanation/Reference:
References: https://www.w3resource.com/python/python-while-loop.php
NEW QUESTION 16
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?
- A. from math import sqrt as squareRoot
- B. import math.sqrt as squareRoot
- C. import sqrt from math as squareRoot
- D. from math.sqrt as squareRoot
Answer: A
Explanation:
References: https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html
NEW QUESTION 17
HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Answer:
Explanation:
References:
https://docs.python.org/2.0/ref/try.html
NEW QUESTION 18
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. No change is needed
- B. The code will generate a syntax error
- C. The code will generate a runtime error
- D. The code runs, but generates a logic error
Answer: A
Explanation:
Explanation/Reference:
References: https://docs.python.org/2/library/exceptions.html
NEW QUESTION 19
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.
Answer Area
Answer:
Explanation:
References:
http://www.pythonforbeginners.com/comments/comments-in-python
https://www.w3resource.com/python/python-string.php
NEW QUESTION 20
HOTSPOT
You are writing a Python program to validate employee numbers.
The employee number must have the format ddd-dd-dddd and consist only of numbers and dashes. The program must print True if the format is correct and print False if the format is incorrect.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Answer:
Explanation:
NEW QUESTION 21
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 22
You are creating a function that reads a data file and prints each line of the file.
You write the following code. Line numbers are included for reference only.
The code attempts to read the file even if the file does not exist.
You need to correct the code.
Which three lines have indentation problems? Each correct answer presents part of the solution. (Choose
three.)
- A. Line 02
- B. Line 01
- C. Line 08
- D. Line 03
- E. Line 06
- F. Line 07
- G. Line 04
- H. Line 05
Answer: C,E,F
NEW QUESTION 23
You are creating a function that manipulates a number. The function has the following requirements:
A float is 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.fmod(x)
- C. math.frexp(x)
- D. math.floor(x)
- E. math.ceil(x)
Answer: A,E
Explanation:
References:
https://docs.python.org/2/library/math.html#number-theoretic-and-representation-functions
NEW QUESTION 24
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.
Hot Area:
Answer:
Explanation:
Explanation/Reference:
References:
https://www.w3resource.com/python/python-data-type.php
https://www.w3resource.com/python/python-if-else-statements.php
NEW QUESTION 25
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 26
You develop a Python application for your company.
A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management.
Which two code segments should you use? Each correct answer presents a complete solution. (Choose two.)
- A. employees [0:-5]
- B. employees [1:-5]
- C. employees [:-5]
- D. employees [0:-4]
- E. employees [1:-4]
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-list.php#slice
NEW QUESTION 27
HOTSPOT
You are developing a Python application for your company.
You write the following code:
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:
Explanation:
References: https://www.w3resource.com/python/python-list.php
NEW QUESTION 28
......
Further Certifications Available
Being an entry-level exam, Microsoft 98-381 offers a myriad of career development opportunities. While it is not an obligatory requirement for any other certification, it provides substantial foundational knowledge that will be highly beneficial. The vendor offers different options for interested candidates such as Microsoft Certified: Microsoft Power Platform Developer Associate, MCSD: App Builder, and others.
What Are Objectives Included in Microsoft 98-381 Evaluation?
The candidates who want to take the Microsoft 98-381 certification exam should demonstrate their skills in the following domains:
- Control flow with decisions and loops (25-30%);
- Perform error handling and troubleshooting (5-10%);
- Perform operations using data types and operators (20-25%).
- Accomplish input and output operations (20-25%);
- Complete operations using tools and modules (1-5%);
- Document and structure code (15-20%);
Domain Document & Structure Code
The fourth part of 98-381 outline covers only 15-20% of the content. That being said, it provides a notable understanding of document as well as structure codes and requires a candidate to gain a better hold over constructing and analyzing those segments of code that involve function definitions.
The questions under this section will assess one's skills in using comments & documentation strings, indentation implementation, and white space. Also, one should have a solid understanding of generating documentation through pydoc, default values, call signatures, and return and pass segments.
Prepare Top Microsoft 98-381 Exam Audio Study Guide Practice Questions Edition: https://www.exam4labs.com/98-381-practice-torrent.html