Exam4Docs 98-381 dumps & Microsoft Python Sure Practice with 42 Questions [Q21-Q41]

Share

Exam4Docs  98-381 dumps & Microsoft Python Sure Practice with 42 Questions

New 98-381 Exam Questions| Real 98-381 Dumps


Domain Taking care of Troubleshooting & Error Handling

Speaking of the fifth domain, it is all about knowing the ins and outs of Python-related troubleshooting and error handling. This section tries to impart best-of-breed understanding about analyzing, detecting and fixing error code segments that are known to involve errors. Applicants have to learn more about the errors related to syntax, logic, and runtime. In addition, one's knowledge of analyzing and constructing exception handling code segments is required.


Microsoft 98-381 Exam Syllabus Topics:

TopicDetails
Topic 1
  • Construct and analyze code segments that perform iteration
  • Perform Operations using Data Types and Operators
Topic 2
  • Construct and analyze code segments that perform console input and output operations
  • Determine the sequence of execution based on operator precedence
Topic 3
  • Document code segments using comments and documentation strings
  • Perform data and data type operations
Topic 4
  • Analyze and construct code segments that handle exceptions
  • Evaluate an expression to identify the data type Python will assign to each variable
Topic 5
  • Analyze, detect, and fix code segments that have errors
  • Identify str, int, float, and bool data types
Topic 7
  • Perform Troubleshooting and Error Handling
  • Convert from one data type to another type
Topic 8
  • Construct data structures; perform indexing and slicing operations
  • Control Flow with Decisions and Loops
Topic 9
  • Construct and analyze code segments that include function definitions
  • Construct and analyze code segments that use branching statements

 

NEW QUESTION 21
HOTSPOT
The ABC company is building a basketball court for its employees to improve company morale.
You are creating a Python program that employees can use to keep track of their average score.
The program must allow users to enter their name and current scores. The program will output the user name and the user's average score. The output must meet the following requirements:
* The user name must be left-aligned.
* If the user name has fewer than 20 characters, additional space must be added to the right.
* The average score must have three places to the left of the decimal point and one place to the right of the decimal (XXX.X).
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:

Explanation:

References: https://www.python-course.eu/python3_formatted_output.php

 

NEW QUESTION 22
You develop a Python application for your company.
A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management.
Which two code segments should you use? Each correct answer presents a complete solution. (Choose two.)

  • A. employees [1:-5]
  • B. employees [0:-4]
  • C. employees [1:-4]
  • D. employees [0:-5]
  • E. employees [:-5]

Answer: D,E

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

 

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:
References:
https://www.w3resource.com/python/python-data-type.php

 

NEW QUESTION 24
HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Answer:

Explanation:

References:
https://docs.python.org/2.0/ref/try.html

 

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

Answer:

Explanation:

Explanation:

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

 

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

Answer: B

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

 

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

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.
Select and Place:

Answer:

Explanation:

Section: (none)
Explanation/Reference:
References: https://www.w3resource.com/python/python-operators.php

 

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

  • A. open("local_data", "r+")
  • B. open("local_data", "w")
  • C. open("local_data", "r")
  • D. open("local_data", "w+")

Answer: A

Explanation:
References:
https://pythontips.com/2014/01/15/the-open-function-explained/

 

NEW QUESTION 30
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 07
  • F. Line 05
  • G. Line 08
  • H. Line 02

Answer: A,E,G

 

NEW QUESTION 31
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 32
HOTSPOT
The ABC company needs a way to find the count of particular letters in their publications to ensure that there is a good balance. It seems that there have been complaints about overuse of the letter e. You need to create a function to meet the requirements.
How should you complete this 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-for-loop.php

 

NEW QUESTION 33
Evaluate the following Python arithmetic expression:

What is the result?

  • A. 0
  • B. 1
  • C. 2
  • D. 3

Answer: A

Explanation:
References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html

 

NEW QUESTION 34
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 ais the value that will be input and bis the result.
You create the following code segment. Line numbers are included for reference only.

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.
Select and Place:

Answer:

Explanation:

Section: (none)

 

NEW QUESTION 35
You are writing code that generates a random integer with a minimum value of 5 and a maximum value of
11.
Which two functions should you use? Each correct answer presents a complete solution. (Choose two.)

  • A. random.randrange(5, 11, 1)
  • B. random.randint(5, 12)
  • C. random.randint(5, 11)
  • D. random.randrange(5, 12, 1)

Answer: A,C

Explanation:
Section: (none)
Explanation/Reference:
References: https://docs.python.org/3/library/random.html#

 

NEW QUESTION 36
DRAG DROP
The ABC company is converting an existing application to Python. You are creating documentation that will be used by several interns who are working on the team.
You need to ensure that arithmetic expressions are coded correctly.
What is the correct order of operations for the six classes of operations ordered from first to last in order of precedence? To answer, move all operations from the list of operations to the answer area and arrange them in the correct order.

Answer:

Explanation:

Explanation:

References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html

 

NEW QUESTION 37
You develop a Python application for your company.
A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management.
Which two code segments should you use? Each correct answer presents a complete solution. (Choose two.)

  • A. employees [1:-5]
  • B. employees [0:-4]
  • C. employees [1:-4]
  • D. employees [0:-5]
  • E. employees [:-5]

Answer: D

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

 

NEW QUESTION 38
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. C.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 39
You develop a Python application for your company.
You need to accept input from the user and print that information to the user screen.
You have started with the following code. Line numbers are included for reference only.

Which code should you write at line 02?

  • A. input("name")
  • B. name = input
  • C. input(name)
  • D. name = input()

Answer: A

 

NEW QUESTION 40
You develop a Python application for your company.
A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management.
Which two code segments should you use? Each correct answer presents a complete solution. (Choose two.)

  • A. employees [1:-5]
  • B. employees [0:-4]
  • C. employees [1:-4]
  • D. employees [0:-5]
  • E. employees [:-5]

Answer: D

Explanation:
Section: (none)
Explanation/Reference:
References: https://www.w3resource.com/python/python-list.php#slice

 

NEW QUESTION 41
......


Difficulty in writing 98-381 Exam

Microsoft Certified Technology Associate Certification exam has a higher rank in the Information Technology sector. Candidate can add the most powerful Microsoft 98-381 certification on their resume by passing Microsoft 98-381 exam. Microsoft 98-381 is a very challenging exam Candidate will have to work hard to pass this exam. With the help of Exam4Docs provided the right focus and preparation material passing this exam is an achievable goal. Exam4Docs provide the most relevant and updated Microsoft 98-381 exam dumps. Furthermore, We also provide the Microsoft 98-381 practice test that will be much beneficial in the preparation. Our aims to provide the best Microsoft 98-381 pdf dumps. We are providing all useful preparation materials such as Microsoft 98-381 dumps that had been verified by the Microsoft experts, Microsoft 98-381 braindumps and customer care service in case of any problem. These are things are very helpful in passing the exam with good grades.

 

98-381 Braindumps – 98-381 Questions to Get Better Grades: https://www.exam4docs.com/98-381-study-questions.html