Online Access Free 98-381 Exam Questions

Exam Code:98-381
Exam Name:Introduction to Programming Using Python
Certification Provider:Microsoft
Free Question Number:42
Posted:Sep 23, 2026
Rating
100%

Question 1

Evaluate the following Python arithmetic expression:

What is the result?

Question 2

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?

Question 3

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.

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?

Question 5

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?

Add Comments

Your email address will not be published. Required fields are marked *

insert code
Type the characters from the picture.