98-381 | Microsoft 98-381 Study Guides 2019

Exam Code: 98-381 (), Exam Name: Introduction to Programming Using Python, Certification Provider: Microsoft Certifitcation, Free Today! Guaranteed Training- Pass 98-381 Exam.

Online Microsoft 98-381 free dumps demo Below:

NEW QUESTION 1
The ABC company is creating a program that allows customers to log the number of miles biked. The program will send messages based on how many miles the customer logs.
You create the following Python code. Line numbers are included for reference only.
98-381 dumps exhibit
You need to define the two required functions.
Which code segments should you use for line 01 and line 04? Each correct answer presents part of the solution? (Choose two.)

  • A. 01 def get_name():
  • B. 01 def get_name(biker):
  • C. 01 def get_name(name):
  • D. 04 def calc_calories():
  • E. 04 def calc_calories(miles, burn_rate):
  • F. 04 def calc_calories(miles, calories_per_mile):

Answer: BE

Explanation: References: https://www.w3resource.com/python/python-user-defined-functions.php

NEW QUESTION 2
DRAG DROP
You are writing a function that works with files.
You need to ensure that the function returns None if the file does not exist. If the file does exist, the function must return the first line.
You write the following code:
98-381 dumps exhibit
In which order should you arrange the code segments to complete the function? To
answer, move all code segments from the list of code segments to the answer area and arrange them in the correct order.
98-381 dumps exhibit

    Answer:

    Explanation: References: http://effbot.org/zone/python-with-statement.htm

    NEW QUESTION 3
    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.
    98-381 dumps exhibit

      Answer:

      Explanation: References: https://www.w3resource.com/python/python-user-defined-functions.php

      NEW QUESTION 4
      HOTSPOT
      You create the following program to locate a conference room and display the room name. Line numbers are included for reference only.
      98-381 dumps exhibit
      Colleagues report that the program sometimes produces incorrect results.
      You need to troubleshoot the program. Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
      98-381 dumps exhibit

        Answer:

        Explanation: References:
        https://www.w3resource.com/python/python-data-type.php https://www.w3resource.com/python/python-if-else-statements.php

        NEW QUESTION 5
        You develop a Python application for your company.
        You want to add notes to your code so other team members will understand it. What should you do?

        • A. Place the notes after the # sign on any line
        • B. Place the notes after the last line of code separated by a blank line
        • C. Place the notes before the first line of code separated by a blank line
        • D. Place the notes inside of parentheses on any time

        Answer: A

        Explanation: References: http://www.pythonforbeginners.com/comments/comments-in-python

        NEW QUESTION 6
        You are creating a function that manipulates a number. The function has the following requirements:
        ✑ A float is passed into the function
        ✑ The function must take the absolute value of the float
        ✑ Any decimal points after the integer must be removed
        Which two math functions should you use? Each correct answer is part of the solution? (Choose two.)

        • A. math.fmod(x)
        • B. math.frexp(x)
        • C. math.floor(x)
        • D. math.ceil(x)
        • E. math.fabs(x)

        Answer: DE

        Explanation: References: https://docs.python.org/2/library/math.html#number-theoretic-and- representation-functions

        NEW QUESTION 7
        DRAG DROP
        You are writing a Python program to perform arithmetic operations. You create the following code:
        98-381 dumps exhibit
        98-381 dumps exhibit
        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.

          Answer:

          Explanation: References: https://www.w3resource.com/python/python-operators.php

          NEW QUESTION 8
          HOTSPOT
          You find errors while evaluating the following code. Line numbers are included for reference only.
          98-381 dumps exhibit
          You need to correct the code at line 03 and line 06.
          How should you correct the code? Use the drop-down menus to select the answer choice
          that answers each question based on the information presented in the code segment. NOTE: Each correct selection is worth one point.
          98-381 dumps exhibit

            Answer:

            Explanation: References: https://www.w3resource.com/python/python-while-loop.php

            NEW QUESTION 9
            HOTSPOT
            The ABC Video company needs a way to determine the cost that a customer will pay for renting a DVD. The cost is dependent on the time of day the DVD is returned. However, there are also special rates on Thursdays and Sundays. The fee structure is shown in the following list:
            ✑ The cost is $1.59 per night.
            ✑ If the DVD is returned after 8 PM, the customer will be charged an extra day.
            ✑ If the video is rented on a Sunday, the customer gets 30% off for as long as they keep the video.
            ✑ If the video is rented on a Thursday, the customer gets 50% off for as long as they keep the video.
            You need to write code to meet the requirements.
            How should you complete the code? To answer, select the appropriate code segments in the answer area.
            98-381 dumps exhibit

              Answer:

              Explanation: References:
              https://www.w3resource.com/python/python-operators.php https://www.w3resource.com/python/python-if-else-statements.php

              NEW QUESTION 10
              DRAG DROP
              You are writing a Python program. The program collects customer data and stores it in a database.
              The program handles a wide variety of data.
              You need to ensure that the program handles the data correctly so that it can be stored in the database correctly.
              Match the data type to the code segment. To answer, drag the appropriate data type from the column on the left to its code segment on the right. Each data type may be used once, more than once, or not at all.
              98-381 dumps exhibit

                Answer:

                Explanation: References: https://www.w3resource.com/python/python-data-type.php

                NEW QUESTION 11
                HOTSPOT
                You are developing a Python application for your company. You write the following code:
                98-381 dumps exhibit
                Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
                98-381 dumps exhibit

                  Answer:

                  Explanation: References: https://www.w3resource.com/python/python-list.php

                  NEW QUESTION 12
                  The ABC company has hired you as an intern on the coding team that creates e-commerce applications.
                  You must write a script that asks the user for a value. The value must be used as a whole number in a calculation, even if the user enters a decimal value.
                  You need to write the code to meet the requirements. Which code segment should you use?

                  • A. totalItems = input(“How many items would you like?”)
                  • B. totalItems = float(input(“How many items would you like?”))
                  • C. totalItems = str(input(“How many items would you like?”))
                  • D. totalItems = int(input(“How many items would you like?”))

                  Answer: A

                  Explanation: References: http://www.informit.com/articles/article.aspx?p=2150451&seqNum=6

                  NEW QUESTION 13
                  DRAG DROP
                  You are writing a Python program that evaluates an arithmetic formula.
                  The formula is described as b equals a multiplied by negative one, then raised to the second power, where a is the value that will be input and b is the result.
                  You create the following code segment. Line numbers are included for reference only.
                  98-381 dumps exhibit
                  98-381 dumps exhibit
                  You need to ensure that the result is correct.
                  How should you complete the code on line 02? To answer, drag the appropriate code segment to the correct location. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
                  NOTE: Each correct selection is worth one point.

                    Answer:

                    Explanation: b = (-a)**2

                    NEW QUESTION 14
                    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?

                    • A. import math.sqrt as squareRoot
                    • B. import sqrt from math as squareRoot
                    • C. from math import sqrt as squareRoot
                    • D. from math.sqrt as squareRoot

                    Answer: C

                    Explanation: References: https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html

                    NEW QUESTION 15
                    You are creating a function that reads a data file and prints each line of the file. You write the following code. Line numbers are included for reference only.
                    98-381 dumps exhibit
                    The code attempts to read the file even if the file does not exist. You need to correct the code.
                    Which three lines have indentation problems? Each correct answer presents part of the solution. (Choose three.)

                    • A. Line 01
                    • B. Line 02
                    • C. Line 03
                    • D. Line 04
                    • E. Line 05
                    • F. Line 06
                    • G. Line 07
                    • H. Line 08

                    Answer: F

                    NEW QUESTION 16
                    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:
                    98-381 dumps exhibit
                    How should you complete the code? To answer, select the appropriate code segments in the answer area.
                    98-381 dumps exhibit

                      Answer:

                      Explanation: References: https://www.w3resource.com/python/python-if-else-statements.php

                      NEW QUESTION 17
                      HOTSPOT
                      During school holidays, you volunteer to explain some basic programming concepts to younger siblings.
                      You want to introduce the concept of data types in Python. You create the following three code segments:
                      98-381 dumps exhibit
                      You need to evaluate the code segments.
                      For each of the following statements, select Yes if the statement is true. Otherwise, select No.
                      NOTE: Each correct selection is worth one point.
                      98-381 dumps exhibit

                        Answer:

                        Explanation: References: https://www.w3resource.com/python/python-data-type.php

                        P.S. Easily pass 98-381 Exam with 40 Q&As Certleader Dumps & pdf Version, Welcome to Download the Newest Certleader 98-381 Dumps: https://www.certleader.com/98-381-dumps.html (40 New Questions)