What Accurate 98-381 Training Tools Is

It is impossible to pass Microsoft 98-381 exam without any help in the short term. Come to Examcollection soon and find the most advanced, correct and guaranteed Microsoft 98-381 practice questions. You will get a surprising result by our Abreast of the times Introduction to Programming Using Python practice guides.

Microsoft 98-381 Free Dumps Questions Online, Read and Test Now.

NEW QUESTION 1
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.
98-381 dumps exhibit
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):

Answer: BE

Explanation:
References: https://www.w3resource.com/python/python-user-defined-functions.php

NEW QUESTION 2
HOTSPOT
You are designing a decision structure to convert a student’s numeric grade to a letter grade. The program must assign a letter grade as specified in the following table:
98-381 dumps exhibit
For example, if the user enters a 90, the output should be, “Your letter grade is A”. Likewise, if a user enters an 89, the output should be “Your letter grade is B”.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

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

NEW QUESTION 3
HOTSPOT
You are developing a Python application for an online game.
You need to create a function that meets the following criteria:
✑ The function is named update_score
✑ The function receives the current score and a value
✑ The function adds the value to the current score
✑ The function returns the new score
How should you complete the code? To answer, select the appropriate code segments in the answer area.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
References: https://www.w3resource.com/python/python-user-defined-functions.php

NEW QUESTION 4
HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

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

NEW QUESTION 5
This question requires that you evaluate the underlined text to determine if it is correct.
You write the following code:
98-381 dumps exhibit
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

Answer: D

Explanation:
References: https://docs.python.org/2/library/exceptions.html

NEW QUESTION 6
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.
98-381 dumps exhibit
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!”

Answer: A

NEW QUESTION 7
HOTSPOT
You find errors while evaluating the following code. Line numbers are included for reference only.
98-381 dumps exhibit
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.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

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

NEW QUESTION 8
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

Answer: C

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

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

Answer: B

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

NEW QUESTION 10
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:
98-381 dumps exhibit
How should you complete the code? To answer, select the appropriate code segments in the answer area.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

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

NEW QUESTION 11
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:
98-381 dumps exhibit
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.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
References: https://www.w3resource.com/python/python-data-type.php

NEW QUESTION 12
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.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
98-381 dumps exhibit

NEW QUESTION 13
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.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
References: https://www.w3resource.com/python/python-data-type.php

NEW QUESTION 14
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.
98-381 dumps exhibit
98-381 dumps exhibit
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.

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
b = (-a)**2

NEW QUESTION 15
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.
98-381 dumps exhibit
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Answer Area
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
References: http://www.pythonforbeginners.com/comments/comments-in-python https://www.w3resource.com/python/python-string.php

NEW QUESTION 16
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?
98-381 dumps exhibit

  • A. name = input
  • B. input(“name”)
  • C. input(name)
  • D. name = input()

Answer: B

NEW QUESTION 17
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: A

Explanation:
References: http://www.informit.com/articles/article.aspx?p=2150451&seqNum=6

NEW QUESTION 18
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.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
References: https://www.w3resource.com/python/python-format.php#num

NEW QUESTION 19
Evaluate the following Python arithmetic expression:
98-381 dumps exhibit
What is the result?

  • A. 3
  • B. 13
  • C. 15
  • D. 69

Answer: C

Explanation:
References: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html

NEW QUESTION 20
......

Recommend!! Get the Full 98-381 dumps in VCE and PDF From 2passeasy, Welcome to Download: https://www.2passeasy.com/dumps/98-381/ (New 40 Q&As Version)