[Newest Version] Free Geekcert Microsoft 98-381 PDF and Exam Questions Download 100% Pass Exam
How to pass MTA Hotest 98-381 pdf exam 100% without any difficulties? We, Geekcert, provide the latest exam preparation material for the Microsoft Newest 98-381 vce Introduction to Programming Using Python exam. Successful candidates share their experience about their MTA Newest 98-381 exam questions exam and the MTA Newest 98-381 study guide exam preparation with Geekcert exam Q and As. Geekcert provides the new VCE and PDF dumps for the latest Newest 98-381 vce exam. We ensure your MTA Jan 14,2022 Newest 98-381 vce Introduction to Programming Using Python exam pass.
98-381 exam academy – free online 98-381 exam study guide resource for 98-381 associate specialty exams. Geekcert – pass all 98-381 certification exams easily with our real exam practice. latest update and experts revised. as a leading 98-381 exam study guides provider, Geekcert provides the latest real test practice for hottest cisco, microsoft, comptia, vmware, ibm, hp, oracle, citrix exams. 100% real and latest.
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.We have sample questions for 98-381 free dumps. You can download and check the real questions of updated 98-381 dumps.
Question 1:
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 2:
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 3:
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.fmod(x)
B. math.frexp(x)
C. math.floor(x)
D. math.ceil(x)
E. math.fabs(x)
Correct Answer: CE
C: math.floor(x) returns the largest integer less than or equal to x.
E: math.fabs(x) returns the absolute value of x. Incorrect Answers:
A: math.fmod() takes two variables
B: math.frexp(x) returns the mantissa and exponent of x as the pair (m, e). m is a float and e is an integer
D: math.ceil(x) returns the smallest integer greater than or equal to x
References: https://docs.python.org/2/library/math.html#number-theoretic-and-representation-functions https://docs.python.org/3/library/math.html
Question 4:
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. import math.sqrt as squareRoot
B. import sqrt from math as squareRoot
C. from math import sqrt as squareRoot
D. from math.sqrt as squareRoot
Correct Answer: C
References: https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html
Question 5:
You are writing code that generates a random integer with a minimum value of 5 and a maximum value of 11. Which two functions should you use? Each correct answer presents a complete solution. (Choose two.)
A. random.randint(5, 12)
B. random.randint(5, 11)
C. random.randrange(5, 12, 1)
D. random.randrange(5, 11, 1)
Correct Answer: BC
References: https://docs.python.org/3/library/random.html#
Question 6:
You develop a Python application for your company.
You need to accept input from the user and print that information to the user screen.
You have started with the following code. Line numbers are included for reference only.
Which code should you write at line 02?
A. name = input
B. input(“name”)
C. input(name)
D. name = input()
Correct Answer: B
Question 7:
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 8:
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 9:
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 10:
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 11:
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:
Correct Answer:
References: https://www.w3resource.com/python/python-while-loop.php
Question 12:
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 13:
DRAG DROP
You are writing a Python program. The program collects customer data and stores it in a database.
The program handles a wide variety of data.
You need to ensure that the program handles the data correctly so that it can be stored in the database correctly.
Match the data type to the code segment. To answer, drag the appropriate data type from the column on the left to its code segment on the right. 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 14:
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 15:
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: