最新的Microsoft Introduction to Programming Using Python - 98-381免費考試真題
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.

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.

正確答案:

References:
https://www.w3resource.com/python/python-user-defined-functions.php
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.
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.
正確答案: B
說明:(僅 Fast2test 成員可見)
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?
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?
正確答案: D
說明:(僅 Fast2test 成員可見)
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.

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.

正確答案:

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

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.

正確答案:

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