Exam Code: 98-381 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Introduction to Programming Using Python
Certification Provider: Microsoft
Free Today! Guaranteed Training- Pass 98-381 Exam.

NEW QUESTION 1
HOTSPOT
You create the following program to locate a conference room and display the room name. Line numbers are included for reference only.
98-381 dumps exhibit
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.
98-381 dumps exhibit

  • A. Mastered
  • B. Not Mastered

Answer: A

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

NEW QUESTION 2
DRAG DROP
You are writing a Python program to perform arithmetic operations. You create the following code:
98-381 dumps exhibit
98-381 dumps exhibit
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.

  • A. Mastered
  • B. Not Mastered

Answer: A

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

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

Answer: F

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

  • A. Mastered
  • B. Not Mastered

Answer: A

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

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

  • A. Mastered
  • B. Not Mastered

Answer: A

Explanation:
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 10
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 11
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 12
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 13
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 14
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

Answer: A

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

NEW QUESTION 15
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 16
......

Thanks for reading the newest 98-381 exam dumps! We recommend you to try the PREMIUM prep-labs.com 98-381 dumps in VCE and PDF here: https://www.prep-labs.com/dumps/98-381/ (40 Q&As Dumps)