HOTSPOT
You work for a company that distributes media for all ages.
You are writing a function that assigns a rating based on a users 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.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
Hot Area:

Explanation:
References:
https://www.w3resource.com/python/python-if-else-statements.php
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.
Hot Area:

Explanation:
References:
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
http://interactivepython.org/runestone/static/pythonds/BasicDS/InfixPrefixandPostfixExpressions.html
DRAG DROP
Match the data type to the type operations.
To answer, drag the appropriate data type to the correct type operation. Each data type may be used once, more than once,
or not at all.
Select and Place:

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

Explanation:
Code Segment 1: You cannot convert str to int. x1 = 2 is a string. Therefore code will produce an error. Code Segment

2: b = 1.5, which is a float.
Code Segment 3: c = 2.5, which is a float, not an int.
References:
https://www.w3resource.com/python/python-data-type.php
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?
C
Explanation:
References:
https://infohost.nmt.edu/tcc/help/pubs/python/web/import-statement.html
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
Explanation:
https://www.dotnetperls.com/readline-python
The ABC company is creating a program that allows customers to log the number of miles biked. The program will send
messages based on how many miles the customer logs.
You create the following Python code. Line numbers are included for reference only.
You need to define the two required functions.
Which code segments should you use for line 01 and line 04? Each correct answer presents part of the solution? (Choose
two.)
A F
Explanation:
References:
https://www.w3resource.com/python/python-user-defined-functions.php
HOTSPOT
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:

Explanation:
References:
https://docs.python.org/2.0/ref/try.html
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.
Hot Area:

Explanation:
References:
https://www.w3resource.com/python/python-data-type.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.
A
Explanation:
References:
https://docs.python.org/2/library/exceptions.html