It is impossible to pass Microsoft 98-381 exam without any help in the short term. Come to Certleader soon and find the most advanced, correct and guaranteed Microsoft 98-381 practice questions. You will get a surprising result by our Up to the immediate present Introduction to Programming Using Python practice guides.
Check 98-381 free dumps before getting the full version:
NEW QUESTION 1
HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://docs.python.org/2.0/ref/try.html
NEW QUESTION 2
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”, “r+”)
- C. open(“local_data”, “w+”)
- D. open(“local_data”, “w”)
Answer: B
Explanation:
References: https://pythontips.com/2014/01/15/the-open-function-explained/
NEW QUESTION 3
HOTSPOT
You are an intern for ABC electric cars company. You must create a function that calculates the average velocity of their vehicles on a 1320 foot (1/4 mile) track. The output must be as precise as possible.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-data-type.php
NEW QUESTION 4
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: http://effbot.org/zone/python-with-statement.htm
NEW QUESTION 5
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References:
https://www.w3resource.com/python/python-operators.php https://www.w3resource.com/python/python-if-else-statements.php
NEW QUESTION 6
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-operators.php
NEW QUESTION 7
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.
- A. No change is needed
- B. The code runs, but generates a logic error
- C. The code will generate a runtime error
- D. The code will generate a syntax error
Answer: D
Explanation:
References: https://docs.python.org/2/library/exceptions.html
NEW QUESTION 8
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:
How should you complete the code? To answer, select the appropriate code segments in the answer area.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-if-else-statements.php
NEW QUESTION 9
HOTSPOT
You are developing a Python application for your company. You write the following code:
Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-list.php
NEW QUESTION 10
HOTSPOT
You develop a Python application for your company.
You have the following code. Line numbers are included for reference only.
Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code segment.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html http://interactivepython.org/runestone/static/pythonds/BasicDS/InfixPrefixandPostfixExpres sions.html
NEW QUESTION 11
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” + (int(end)-int(start)) + “years of service!”
- B. print(“Congratulations on” + str(int(end)-int(start)) + “years of service!”
- C. print(“Congratulations on” + int(end - start) + “years of service!”
- D. print(“Congratulations on” + str(end - start)) + “years of service!”
Answer: A
NEW QUESTION 12
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-format.php#num
NEW QUESTION 13
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-if-else-statements.php
NEW QUESTION 14
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.python-course.eu/python3_formatted_output.php
NEW QUESTION 15
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 True if the format is correct and print False if the format is incorrect.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
NEW QUESTION 16
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.randint(5, 12)
- B. random.randint(5, 11)
- C. random.randrange(5, 12, 1)
- D. random.randrange(5, 11, 1)
Answer: BD
Explanation:
References: https://docs.python.org/3/library/random.html#
NEW QUESTION 17
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 18
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-while-loop.php
NEW QUESTION 19
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
References: https://www.w3resource.com/python/python-data-type.php
NEW QUESTION 20
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.
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.
- A. Mastered
- B. Not Mastered
Answer: A
Explanation:
b = (-a)**2
NEW QUESTION 21
......
P.S. Easily pass 98-381 Exam with 40 Q&As Certshared Dumps & pdf Version, Welcome to Download the Newest Certshared 98-381 Dumps: https://www.certshared.com/exam/98-381/ (40 New Questions)