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.
Solution:
References: https://www.w3resource.com/python/python-for-loop.php
Does this meet the goal?
Correct Answer:
A
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.
Solution:
References: https://www.w3resource.com/python/python-list.php
Does this meet the goal?
Correct Answer:
A
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.
Solution:
References: https://www.w3resource.com/python/python-if-else-statements.php
Does this meet the goal?
Correct Answer:
A
HOTSPOT
You work for a company that distributes media for all ages.
You are writing a function that assigns a rating based on a user’s age. The function must meet the following requirements:
✑ Anyone 18 years old or older receives a rating of “A”
✑ Anyone 13 or older, but younger than 18, receives a rating of “T”
✑ Anyone 12 years old or younger receives a rating of “C”
✑ If the age is unknown, the rating is set to “C”
You need to complete the code to meet the requirements.
Solution:
References: https://www.w3resource.com/python/python-if-else-statements.php
Does this meet the goal?
Correct Answer:
A
DRAG DROP
You are building a Python program that displays all of the prime numbers from 2 to 100.
How should you complete the code? To answer, drag the appropriate code segments 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.
Solution:
References: https://docs.python.org/3.1/tutorial/inputoutput.html
https://stackoverflow.com/questions/11619942/print-series-of-prime-numbers-in-python https://www.programiz.com/python-programming/examples/prime-number-intervals
Does this meet the goal?
Correct Answer:
A