[Q13-Q35] Latest Microsoft 98-381 First Attempt, Exam real Dumps Updated [Sep-2021]

Share

Latest Microsoft 98-381 First Attempt, Exam real Dumps Updated [Sep-2021]

Get the superior quality 98-381 Dumps Questions from VCEPrep. Nobody can stop you from getting to your dreams now. Your bright future is just a click away!

NEW QUESTION 13
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 14
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 [1:-5]
  • C. employees [0:-5]
  • D. employees [:-5]
  • E. employees [0:-4]

Answer: C,D

Explanation:
Explanation/Reference:
References: https://www.w3resource.com/python/python-list.php#slice

 

NEW QUESTION 15
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. input(name)
  • B. name = input
  • C. input("name")
  • D. name = input()

Answer: C

 

NEW QUESTION 16
You are writing an application that uses the sqrtfunction. The program must reference the function using the name squareRoot.
You need to import the function.
Which code segment should you use?

  • A. import sqrt from math as squareRoot
  • B. from math import sqrt as squareRoot
  • C. from math.sqrt as squareRoot
  • D. import math.sqrt as squareRoot

Answer: B

Explanation:
Explanation/Reference:
References: https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html

 

NEW QUESTION 17
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:-5]
  • E. employees [0:-4]

Answer: D

Explanation:
References:
https://www.w3resource.com/python/python-list.php#slice

 

NEW QUESTION 18
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" + str(int(end)-int(start)) + "years of service!"
  • B. print("Congratulations on" + int(end - start) + "years of service!"
  • C. print("Congratulations on" + str(end - start)) + "years of service!"
  • D. print("Congratulations on" + (int(end)-int(start)) + "years of service!"

Answer: D

 

NEW QUESTION 19
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 inside of parentheses on any time
  • C. Place the notes before the first line of code separated by a blank line
  • D. Place the notes after the last line of code separated by a blank line

Answer: A

Explanation:
References: http://www.pythonforbeginners.com/comments/comments-in-python

 

NEW QUESTION 20
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", "w")
  • C. open("local_data", "r+")
  • D. open("local_data", "r")

Answer: C

Explanation:
References:
https://pythontips.com/2014/01/15/the-open-function-explained/

 

NEW QUESTION 21
HOTSPOT
You develop a Python application for your company.
You have the following code. Line numbers are included for reference only.

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:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
http://interactivepython.org/runestone/static/pythonds/BasicDS/InfixPrefixandPostfixExpres sions.html

 

NEW QUESTION 22
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 23
HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:

Answer:

Explanation:

Explanation/Reference:
References: https://docs.python.org/2.0/ref/try.html

 

NEW QUESTION 24
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.
Hot Area:

Answer:

Explanation:

Section: (none)
Explanation/Reference:
References: https://www.w3resource.com/python/python-data-type.php

 

NEW QUESTION 25
HOTSPOT
The ABC company is building a basketball court for its employees to improve company morale.
You are creating a Python program that employees can use to keep track of their average score.
The program must allow users to enter their name and current scores. The program will output the user name and the user's average score. The output must meet the following requirements:
The user name must be left-aligned.

If the user name has fewer than 20 characters, additional space must be added to the right.

The average score must have three places to the left of the decimal point and one place to the right of

the decimal (XXX.X).
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.python-course.eu/python3_formatted_output.php

 

NEW QUESTION 26
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 27
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.fmod(x)
  • C. math.floor(x)
  • D. math.frexp(x)
  • E. math.ceil(x)

Answer: A,C

Explanation:
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

 

NEW QUESTION 28
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.fmod(x)
  • C. math.floor(x)
  • D. math.frexp(x)
  • E. math.ceil(x)

Answer: A,E

Explanation:
Explanation/Reference:
References: https://docs.python.org/2/library/math.html#number-theoretic-and-representation-functions

 

NEW QUESTION 29
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:

Explanation:

References: https://www.w3resource.com/python/python-while-loop.php

 

NEW QUESTION 30
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", "w")
  • C. open("local_data", "r+")
  • D. open("local_data", "r")

Answer: C

Explanation:
Section: (none)
Explanation/Reference:
References: https://pythontips.com/2014/01/15/the-open-function-explained/

 

NEW QUESTION 31
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:

References:
https://www.w3resource.com/python/python-operators.php
https://www.w3resource.com/python/python-if-else-statements.php

 

NEW QUESTION 32
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.randrange(5, 11, 1)
  • C. random.randrange(5, 12, 1)
  • D. random.randint(5, 11)

Answer: B,D

Explanation:
References: https://docs.python.org/3/library/random.html#

 

NEW QUESTION 33
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!")
    print("Congratulations on" + str(int(end)-int(start)) +
  • B. "years of service!")
    print("Congratulations on" + int(end - start) +
  • C. "years of service!")
  • D. "years of service!")
    print("Congratulations on" + str(end - start)) +

Answer: B

Explanation:
Explanation/Reference:
int must be converted to string

 

NEW QUESTION 34
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.

Answer:

Explanation:

Explanation:

References: http://effbot.org/zone/python-with-statement.htm

 

NEW QUESTION 35
......

Guaranteed Success with Valid Microsoft 98-381 Dumps: https://www.vceprep.com/98-381-latest-vce-prep.html