Microsoft 98-381 Actual Free Exam Questions & Community Discussion

  • Exam Code/Number: 98-381
  • Exam Name/Title: Introduction to Programming Using Python
  • Certification Provider: Microsoft
  • Corresponding Certification: Microsoft Python
  • Exam Questions: 42
  • Updated On: May 26, 2026
DRAG DROP
You are writing a Python program to perform arithmetic operations.
You create the following code:


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.
Correct Answer:

References:
https://www.w3resource.com/python/python-operators.php
HOTSPOT
You work for a company that distributes media for all ages.
You are writing a function that assigns a rating based on a user's age. The function must meet the following requirements:
Anyone 18 years old or older receives a rating of "A"
Anyone 13 or older, but younger than 18, receives a rating of "T"
Anyone 12 years old or younger receives a rating of "C"
If the age is unknown, the rating is set to "C"
You need to complete the code to meet the requirements.
Correct Answer:

References:
https://www.w3resource.com/python/python-if-else-statements.php
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.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Answer Area
Correct Answer:

References:
http://www.pythonforbeginners.com/comments/comments-in-python
https://www.w3resource.com/python/python-string.php
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.
Correct Answer:

References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
http://interactivepython.org/runestone/static/pythonds/BasicDS/InfixPrefixandPostfixExpressions.html
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?
Correct Answer: D Vote an answer
0
0
0
10