98-381 Exam Question 21

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.
Hot Area:

98-381 Exam Question 22

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.
  • 98-381 Exam Question 23

    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 Trueif the format is correct and print Falseif the format is incorrect.
    How should you complete the code? To answer, select the appropriate code segments in the answer area.
    Hot Area:

    98-381 Exam Question 24

    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:

    98-381 Exam Question 25

    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.