Leads4pass > Microsoft > Microsoft Certifications > 98-381 > 98-381 Online Practice Questions and Answers

98-381 Online Practice Questions and Answers

Questions 4

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:

Buy Now
Questions 5

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:

Buy Now
Questions 6

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:

Buy Now
Questions 7

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.

Hot Area:

Buy Now
Questions 8

HOTSPOT

The ABC company needs a way to find the count of particular letters in their publications to ensure that there is a good balance. It seems that there have been complaints about overuse of the letter e. You need to create a function to meet the

requirements.

How should you complete this code? To answer, select the appropriate code segments in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Buy Now
Questions 9

Evaluate the following Python arithmetic expression:

What is the result?

A. 3

B. 13

C. 15

D. 69

Buy Now
Questions 10

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)

Buy Now
Questions 11

You are writing a Python program to automate inventory. Your first task is to read a file of inventory transactions. The file contains sales from the previous day, including the item id, price, and quantity. The following shows a sample of data from the file:

The code must meet the following requirements: Each line of the file must be read and printed If a blank line is encountered, it must be ignored When all lines have been read, the file must be closed

You create the following code. Line numbers are included for reference only.

Which code should you write for line 05 and line 06?

A. Option A

B. Option B

C. Option C

D. Option D

Buy Now
Questions 12

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()

Buy Now
Questions 13

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

Buy Now
Exam Code: 98-381
Exam Name: Introduction to Programming Using Python
Last Update: May 31, 2026
Questions: 40
10%OFF Coupon Code: SAVE10

PDF (Q&A)

$49.99

VCE

$55.99

PDF + VCE

$65.99