Download Microsoft.98-381.TestKing.2018-07-10.23q.vcex

Download Exam

File Info

Exam Introduction to Programming Using Python
Number 98-381
File Name Microsoft.98-381.TestKing.2018-07-10.23q.vcex
Size 1 MB
Posted Jul 10, 2018
Download Microsoft.98-381.TestKing.2018-07-10.23q.vcex

How to open VCEX & EXAM Files?

Files with VCEX & EXAM extensions can be opened by ProfExam Simulator.

Purchase

Coupon: MASTEREXAM
With discount: 20%






Demo Questions

Question 1

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.


Correct answer: To work with this question, an Exam Simulator is required.
Explanation:
References: https://www.w3resource.com/python/python-while-loop.php
References: https://www.w3resource.com/python/python-while-loop.php



Question 2

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? 


  1. totalItems = input(“How many items would you like?”)
  2. totalItems = float(input(“How many items would you like?”))
  3. totalItems = str(input(“How many items would you like?”))
  4. totalItems = int(input(“How many items would you like?”))
Correct answer: A
Explanation:
References: http://www.informit.com/articles/article.aspx?p=2150451&seqNum=6
References: http://www.informit.com/articles/article.aspx?p=2150451&seqNum=6



Question 3

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?


  1. print(“Congratulations on” + (int(end)-int(start)) + “years of service!”
  2. print(“Congratulations on” + str(int(end)-int(start)) + “years of service!”
  3. print(“Congratulations on” + int(end - start) + “years of service!”
  4. print(“Congratulations on” + str(end - start)) + “years of service!”
Correct answer: A



Question 4

Evaluate the following Python arithmetic expression:
 
 
What is the result?


  1. 3
  2. 13
  3. 15
  4. 69
Correct answer: C
Explanation:
References: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
References: http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html



Question 5

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.)


  1. employees [1:-4]
  2. employees [:-5]
  3. employees [1:-5]
  4. employees [0:-4]
  5. employees [0:-5]
Correct answer: BE
Explanation:
References: https://www.w3resource.com/python/python-list.php#slice
References: https://www.w3resource.com/python/python-list.php#slice



Question 6

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.


Correct answer: To work with this question, an Exam Simulator is required.
Explanation:
References: https://www.w3resource.com/python/python-data-type.php
References: https://www.w3resource.com/python/python-data-type.php



Question 7

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.)


  1. math.fmod(x)
  2. math.frexp(x)
  3. math.floor(x)
  4. math.ceil(x)
  5. math.fabs(x)
Correct answer: DE
Explanation:
References: https://docs.python.org/2/library/math.html#number-theoretic-and-representation-functions
References: https://docs.python.org/2/library/math.html#number-theoretic-and-representation-functions



Question 8

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?


  1. import math.sqrt as squareRoot
  2. import sqrt from math as squareRoot
  3. from math import sqrt as squareRoot
  4. from math.sqrt as squareRoot
Correct answer: C
Explanation:
References: https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html
References: https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html



Question 9

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.)


  1. random.randint(5, 12)
  2. random.randint(5, 11)
  3. random.randrange(5, 12, 1)
  4. random.randrange(5, 11, 1)
Correct answer: BC
Explanation:
References: https://docs.python.org/3/library/random.html#
References: https://docs.python.org/3/library/random.html#



Question 10

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.


Correct answer: To work with this question, an Exam Simulator is required.
Explanation:
References: http://effbot.org/zone/python-with-statement.htm
References: http://effbot.org/zone/python-with-statement.htm









CONNECT US

Facebook

Twitter

PROFEXAM WITH A 20% DISCOUNT

You can buy ProfExam with a 20% discount!



HOW TO OPEN VCEX FILES

Use ProfExam Simulator to open VCEX files