98-381 Exam Question 36

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?
  • 98-381 Exam Question 37

    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?
  • 98-381 Exam Question 38

    You are creating a Python program that shows a congratulation message to employees on their service anniversary.
    You need to calculate the number of years of service and print a congratulatory message.
    You have written the following code. Line numbers are included for reference only.

    You need to complete the program.
    Which code should you use at line 03?
  • 98-381 Exam Question 39

    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:

    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:

    98-381 Exam Question 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.
    How should you complete the code? To answer, select the appropriate code segments in the answer area.
    Hot Area:

    Premium Bundle

    Newest 98-381 Exam PDF Dumps shared by Actual4test.com for Helping Passing 98-381 Exam! Actual4test.com now offer the updated 98-381 exam dumps, the Actual4test.com 98-381 exam questions have been updated and answers have been corrected get the latest Actual4test.com 98-381 pdf dumps with Exam Engine here:


    (42 Q&As Dumps, 30%OFF Special Discount: Freepdfdumps)
    Other Version
    1133Microsoft.98-381.v2021-12-15.q38
    75Microsoft.Actual4test.98-381.v2021-09-30.by.kent.39q.pdf
    Latest Upload
    166ACSM.020-222.v2025-09-11.q48
    156VMware.5V0-31.23.v2025-09-10.q73
    130Oracle.1z0-915-1.v2025-09-10.q24
    159Citrix.1Y0-231.v2025-09-10.q87
    134SAP.C-THR85-2505.v2025-09-09.q29
    165Adobe.AD0-E727.v2025-09-09.q76
    129Oracle.1Z0-1123-25.v2025-09-09.q20
    134SAP.C_SIGPM_2403.v2025-09-08.q20
    253EXIN.ITIL.v2025-09-08.q161
    169BCS.PC-BA-FBA-20.v2025-09-08.q45