Introduction to Programming Using Python

Here you have the best Microsoft 98-381 practice exam questions

  • You have 40 total questions across 8 pages (5 per page)
  • These questions were last updated on February 15, 2026
  • This site is not affiliated with or endorsed by Microsoft.
Question 1 of 40

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 if the format is incorrect.

False -
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
Exam 98-381: Question 1 - Image 1
Answer
Suggested Answer:
Exam 98-381: Question 1 - Image 2

Community votes

No votes yet

Question 2 of 40

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:
Exam 98-381: Question 2 - Image 1
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:
Exam 98-381: Question 2 - Image 2
Answer
Suggested Answer:
References: https://www.w3resource.com/python/python-if-else-statements.php Exam 98-381: Question 2 - Image 3

Community votes

No votes yet

Question 3 of 40

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.
Hot Area:
Exam 98-381: Question 3 - Image 1
Answer
Suggested Answer:
References: https://www.w3resource.com/python/python-if-else-statements.php Exam 98-381: Question 3 - Image 2

Community votes

No votes yet

Question 4 of 40

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:
Exam 98-381: Question 4 - Image 1
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.
Hot Area:
Exam 98-381: Question 4 - Image 2
Answer
Suggested Answer:
References: https://www.w3resource.com/python/python-if-else-statements.php Exam 98-381: Question 4 - Image 3

Community votes

No votes yet

Question 5 of 40

You are developing a Python application for an online product distribution company.
You need the program to iterate through a list of products and escape when a target product ID is found.
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.
Hot Area:
Exam 98-381: Question 5 - Image 1
Answer
Suggested Answer:
References: https://www.w3resource.com/python/python-while-loop.php Exam 98-381: Question 5 - Image 2

Community votes

No votes yet

About the Microsoft 98-381 Certification Exam

About the Exam

The Microsoft 98-381 (Introduction to Programming Using Python) validates your knowledge and skills. Passing demonstrates proficiency and can boost your career prospects in the field.

How to Prepare

Work through all 40 practice questions across 8 pages. Focus on understanding the reasoning behind each answer rather than memorizing responses to be ready for any variation on the real exam.

Why Practice Exams?

Practice exams help you familiarize yourself with the question format, manage your time, and reduce anxiety on the test day. Our 98-381 questions are regularly updated to reflect the latest exam objectives.