Brilliant 98-381 Exam Dumps Get 98-381 Dumps PDF [Q10-Q32]

Share

Brilliant 98-381 Exam Dumps Get 98-381 Dumps PDF

98-381 Dumps PDF - 98-381 Real Exam Questions Answers

NEW QUESTION 10
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?
A:

B:

C:

D:

  • A. Option D
  • B. Option B
  • C. Option A
  • D. Option C

Answer: C

Explanation:
Explanation/Reference:
https://www.dotnetperls.com/readline-python

 

NEW QUESTION 11
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.

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 06
  • B. Line 03
  • C. Line 01
  • D. Line 04
  • E. Line 08
  • F. Line 05
  • G. Line 07
  • H. Line 02

Answer: A

Explanation:
Explanation:

 

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 = str(input("How many items would you like?"))
  • B. totalItems = input("How many items would you like?")
  • C. totalItems = float(input("How many items would you like?"))
  • D. totalItems = int(input("How many items would you like?"))

Answer: B

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

 

NEW QUESTION 13
HOTSPOT
You create the following program to locate a conference room and display the room name.
Line numbers are included for reference only.

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.

Answer:

Explanation:

Explanation:

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

 

NEW QUESTION 14
HOTSPOT
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.

Answer:

Explanation:

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

 

NEW QUESTION 15
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:

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.

Answer:

Explanation:

Explanation:

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

 

NEW QUESTION 16
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 inside of parentheses on any time
  • B. Place the notes after the # sign on any line
  • C. Place the notes after the last line of code separated by a blank line
  • D. Place the notes before the first line of code separated by a blank line

Answer: B

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

 

NEW QUESTION 17
HOTSPOT
The ABC organics company needs a simple program that their call center will use to enter survey data for a new coffee variety.
The program must accept input and return the average rating based on a five-star scale. The output must be rounded to two decimal places.
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.
NOTE: Each correct selection is worth one point.

Answer:

Explanation:

References:
https://www.w3resource.com/python/python-format.php#num

 

NEW QUESTION 18
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.

Answer:

Explanation:

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

 

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

  • A. print("Congratulations on" + str(end - start)) + "years of service!"
  • B. print("Congratulations on" + str(int(end)-int(start)) + "years of service!"
  • C. print("Congratulations on" + (int(end)-int(start)) + "years of service!"
  • D. print("Congratulations on" + int(end - start) + "years of service!"

Answer: C

 

NEW QUESTION 20
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:

Answer:

Explanation:

Explanation/Reference:
References:
http://www.pythonforbeginners.com/comments/comments-in-python
https://www.w3resource.com/python/python-string.php

 

NEW QUESTION 21
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.

Answer:

Explanation:

Explanation:

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

 

NEW QUESTION 22
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?
A:

B:

C:

D:

  • A. Option D
  • B. Option A
  • C. Option C
  • D. Option B

Answer: D

Explanation:
Section: (none)

 

NEW QUESTION 23
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:

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.

Answer:

Explanation:

Explanation:

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

 

NEW QUESTION 24
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.fabs(x)
  • B. math.frexp(x)
  • C. math.floor(x)
  • D. math.ceil(x)
  • E. math.fmod(x)

Answer: A,D

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

 

NEW QUESTION 25
DRAG DROP
You are creating a Python script to evaluate input and check for upper and lower case.
Which four code segments should you use to develop the solution? To answer, move the appropriate code segment from the list of code segments to the answer area and arrange them in the correct order.

Answer:

Explanation:

Explanation:

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

 

NEW QUESTION 26
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:

Answer:

Explanation:

 

NEW QUESTION 27
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:

Answer:

Explanation:

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

 

NEW QUESTION 28
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.

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. 04 def calc_calories(miles, burn_rate):
  • B. 01 def get_name(biker):
  • C. 01 def get_name():
  • D. 04 def calc_calories(miles, calories_per_mile):
  • E. 04 def calc_calories():
  • F. 01 def get_name(name):

Answer: C,D

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

 

NEW QUESTION 29
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 inside of parentheses on any time
  • B. Place the notes after the last line of code separated by a blank line
  • C. Place the notes after the #sign on any line
  • D. Place the notes before the first line of code separated by a blank line

Answer: C

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

 

NEW QUESTION 30
You are writing an application that uses the sqrtfunction. 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.sqrt as squareRoot
  • D. from math import sqrt as squareRoot

Answer: D

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

 

NEW QUESTION 31
DRAG DROP
You are creating a Python script to evaluate input and check for upper and lower case.
Which four code segments should you use to develop the solution? To answer, move the appropriate code segment from the list of code segments to the answer area and arrange them in the correct order.
Select and Place:

Answer:

Explanation:

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

 

NEW QUESTION 32
......


Introduction to Programming Using Python 98-381 Exam

Introduction to Programming Using Python 98-381 Exam which is related to Microsoft Certified Technology Associate Certification. This exam measures and validates the Candidates ability to recognize and write syntactically correct Python code, recognize data types supported by Python, and have the working experience of writing code of Python language that will logically solve a given problem. Microsoft Technology Associate usually holds or pursue this certification and you can expect the same job role after completion of this certification.

 

Valid 98-381 Test Answers & Microsoft 98-381 Exam PDF: https://www.examtorrent.com/98-381-valid-vce-dumps.html