In recent years, many people choose to take Microsoft MTA Newest 98-381 study guide certification exam. This certification will make you get a position the Microsoft certified and that is the passport to get a better salary and better promotions. How to prepare for Microsoft MTA Jan 15,2022 Newest 98-381 exam questions exam and get the certificate? We, Geekcert, will provide Microsoft MTA Latest 98-381 study guide exam questions and answers on Geekcert.
pass the 98-381 exam on your first attempt with Geekcert! Geekcert provides you the easiest way to pass your 98-381 certification exam. association of certification 98-381 exam resources – Geekcert. Geekcert – clear all your 98-381 certification exams with Geekcert study guide. 100% pass rate and money back guarantee.
We Geekcert has our own expert team. They selected and published the latest 98-381 preparation materials from Microsoft Official Exam-Center: https://www.geekcert.com/98-381.html
The following are the 98-381 free dumps. Go through and check the validity and accuracy of our 98-381 dumps.Although questions are from 98-381 free dumps, the validity and accuracy of the 98-381 dumps are absolutely guaranteed.
Question 1:
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?”))
Correct Answer: B
References: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html
Question 2:
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?
A. print(“Congratulations on” (int(end)-int(start)) “years of service!”)
B. print(“Congratulations on” str(int(end)-int(start)) “years of service!”)
C. print(“Congratulations on” int(end – start) “years of service!”)
D. print(“Congratulations on” str(end – start)) “years of service!”)
Correct Answer: B
int must be converted to string
Question 3:
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 [1:-4]
B. employees [:-5]
C. employees [1:-5]
D. employees [0:-4]
E. employees [0:-5]
Correct Answer: BE
References: https://www.w3resource.com/python/python-list.php#slice
Question 4:
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 01
B. Line 02
C. Line 03
D. Line 04
E. Line 05
F. Line 06
G. Line 07
H. Line 08
Correct Answer: FGH
Question 5:
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 runs, but generates a logic error
C. The code will generate a runtime error
D. The code will generate a syntax error
Correct Answer: A
References: https://docs.python.org/2/library/exceptions.html
Question 6:
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 after the # sign on any line
B. Place the notes after the last line of code separated by a blank line
C. Place the notes before the first line of code separated by a blank line
D. Place the notes inside of parentheses on any time
Correct Answer: A
References: http://www.pythonforbeginners.com/comments/comments-in-python
Question 7:
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():
B. 01 def get_name(biker):
C. 01 def get_name(name):
D. 04 def calc_calories():
E. 04 def calc_calories(miles, burn_rate):
F. 04 def calc_calories(miles, calories_per_mile):
Correct Answer: AF
References: https://www.w3resource.com/python/python-user-defined-functions.php
Question 8:
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:
Correct Answer:
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
Question 9:
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:
Correct Answer:
References: https://www.w3resource.com/python/python-data-type.php
Question 10:
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:
Correct Answer:
References: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
Question 11:
DRAG DROP
You are writing a Python program to perform arithmetic operations.
You create the following code:
What is the result of each arithmetic expression? To answer, drag the appropriate expression from the column on the left to its result on the right. Each expression may be used once, more than once, or not at all.
Select and Place:
Correct Answer:
Question 12:
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:
Correct Answer:
Question 13:
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:
Correct Answer:
Question 14:
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.
Hot Area:
Correct Answer:
Question 15:
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:
Correct Answer: