WGU D335 Intro to Python OA |Objective Assessment 15
Questions and 100% Correct Answers Latest 2025/2026
Update.
Create a solution that accepts an integer input representing water
temperature in degrees Fahrenheit. Output a description of the water
state based on the following scale:
If the temperature is below 33° F, the water is "Frozen".
If the water is between 33° F and 80° F (including 33), the water is
"Cold".
If the water is between 80° F and 115° F (including 80), the water is
"Warm".
If the water is between 115° F and 211° (including 115) F, the water is
,"Hot".
If the water is greater than or equal to 212° F, the water is "Boiling".
Additionally, output a safety comment only during the following
circumstances:
If the water is exactly 212° F, the safety comment is "Caution: Hot!"
If the water temperature is less than 33° F, the safety comment is
"Watch out for ice!"
store_item = input()
num_items = int(input())
total_cost = purchase[store_item] * num_items
if num_items < 10:
print(store_item, "${:.2f}".format(total_cost))
if num_items in range(10,21):
discount = total_cost * 0.05
total_cost = total_cost - discount
print(store_item, '${:.2f}'.format(total_cost))
if num_items >= 21:
discount = total_cost * 0.10
total_cost = total_cost - discount
print(store_item, '${:.2f}'.format(total_cost))
index_value = int(input())
try:
if index_value == 0:
print(frameworks[0])
if index_value == 1:
print(frameworks[1])
if index_value == 2:
print(frameworks[2])
if index_value == 3:
print(frameworks[3])
if index_value == 4:
, print(frameworks[4])
if index_value == 5:
print(frameworks[5])
if index_value > 5:
print(frameworks[index_value])
except:
print('Error')
file_name = input()
with open(file_name, 'r') as f:
word1 = str(f.readline()).strip()
word2 = str(f.readline()).strip()
word3 = str(f.readline()).strip()
f = open(file_name, 'r')
lines = f.read().splitlines()
lines = ' '.join(lines)
f.close()
print(f'{word1}\n{word2}\n{word3}\n{lines}')
temperature = int(input())
if temperature <33:
print('Frozen')
print('Watch out for ice!')
if temperature in range(33, 80):
print('Cold')
if temperature in range(80, 115):
print('Warm')
if temperature in range(115, 211):
print('Hot')
if temperature >= 212:
print('Boiling')
if temperature == 212:
print('Caution: Hot!')
Don't know?
Questions and 100% Correct Answers Latest 2025/2026
Update.
Create a solution that accepts an integer input representing water
temperature in degrees Fahrenheit. Output a description of the water
state based on the following scale:
If the temperature is below 33° F, the water is "Frozen".
If the water is between 33° F and 80° F (including 33), the water is
"Cold".
If the water is between 80° F and 115° F (including 80), the water is
"Warm".
If the water is between 115° F and 211° (including 115) F, the water is
,"Hot".
If the water is greater than or equal to 212° F, the water is "Boiling".
Additionally, output a safety comment only during the following
circumstances:
If the water is exactly 212° F, the safety comment is "Caution: Hot!"
If the water temperature is less than 33° F, the safety comment is
"Watch out for ice!"
store_item = input()
num_items = int(input())
total_cost = purchase[store_item] * num_items
if num_items < 10:
print(store_item, "${:.2f}".format(total_cost))
if num_items in range(10,21):
discount = total_cost * 0.05
total_cost = total_cost - discount
print(store_item, '${:.2f}'.format(total_cost))
if num_items >= 21:
discount = total_cost * 0.10
total_cost = total_cost - discount
print(store_item, '${:.2f}'.format(total_cost))
index_value = int(input())
try:
if index_value == 0:
print(frameworks[0])
if index_value == 1:
print(frameworks[1])
if index_value == 2:
print(frameworks[2])
if index_value == 3:
print(frameworks[3])
if index_value == 4:
, print(frameworks[4])
if index_value == 5:
print(frameworks[5])
if index_value > 5:
print(frameworks[index_value])
except:
print('Error')
file_name = input()
with open(file_name, 'r') as f:
word1 = str(f.readline()).strip()
word2 = str(f.readline()).strip()
word3 = str(f.readline()).strip()
f = open(file_name, 'r')
lines = f.read().splitlines()
lines = ' '.join(lines)
f.close()
print(f'{word1}\n{word2}\n{word3}\n{lines}')
temperature = int(input())
if temperature <33:
print('Frozen')
print('Watch out for ice!')
if temperature in range(33, 80):
print('Cold')
if temperature in range(80, 115):
print('Warm')
if temperature in range(115, 211):
print('Hot')
if temperature >= 212:
print('Boiling')
if temperature == 212:
print('Caution: Hot!')
Don't know?