OBJECTIVE ASSESSMENT ACTUAL
QUESTIONS AND ANSWERS 2026
UPDATE 100% CORRECT ALREADY
GRADED A+ LATEST VERSION
"Create a solution that accepts an integer input representing the index value for any any of the
five elements in the following list:
various_data_types = [516, 112.49, True, "meow", ("Western", "Governors", "University"),
{"apple": 1, "pear": 5}]
Using the built-in function type() and getting its name by using the .name attribute, output data
type (e.g., int", "float", "bool", "str") based on the input index value of the list element. -
CORRECT ANSWER=>index_value = int(input())
name = various_data_types[index_value]
data_type = type(name).__name__
print(f"Element {index_value}: {data_type}")"
"Create a solution that accepts an integer input. Import the built-in module math and use its
factorial() method to calculate the factorial of the integer input. Output the value of the
factorial, as well as a Boolean value identifying whether the factorial output is greater than 100.
- CORRECT ANSWER=>import math
fact = int(input())
x = math.factorial(fact)
print(x)
if x > 100:
print('True')
else:
print('False')"
"Create a solution that accepts any three integer inputs representing the base (b1, b2) and
height (h) measurements of a trapezoid in meters. Output the exact area of the trapezoid in
1|Page
,square meters as a float value. The exact area of a trapezoid can be calculated by finding the
average of the two base measurements, then multiplying by the height measurement.
Trapezoid Area Formula:A = [(b1 + b2) / 2] * h - CORRECT ANSWER=>b1 = int(input())
b2 = int(input())
h = int(input())
area_value = ((b1 + b2) /2) * h
print('Trapezoid area: {:.1f} square meters'.format(area_value))"
"Create a solution that accepts an integer input representing the age of a pig. Import the
existing module pigAge and use its pre-built pigAge_converter() function to calculate the human
equivalent age of a pig. A year in a pig's life is equivalent to five years in a human's life. Output
the human-equivalent age of the pig. - CORRECT ANSWER=>import pigAge
def pigAge_converter(pig_age):
return pig_age * 5
pig_age = int(input())
converted_pig_age = pigAge_converter(pig_age)
print(f'{pig_age} is {converted_pig_age} in human years')"
"Create a solution that accepts five integer inputs. Output the sum of the five inputs three
times, converting the inputs to the requested data type prior to finding the sum.
First output: sum of five inputs maintained as integer values
Second output: sum of five inputs converted to float values
Third output: sum of five inputs converted to string values (concatenate) - CORRECT
ANSWER=>num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input())
num5 = int(input())
first_output = num1 + num2 + num3 + num4 + num5
second_output = float(num1) + float(num2) + float(num3) + float(num4) + float(num5)
third_output = str(num1) + str(num2) + str(num3) + str(num4) + str(num5)
print('Integer: {}'.format(first_output))
print('Float: {}'.format(second_output))
print('String: {}'.format(third_output))"
"Create a solution that accepts a string input representing a grocery store item and an integer
input identifying the number of items purchased on a recent visit. The following dictionary
purchase lists available items as the key with the cost per item as the value.
2|Page
, purchase = {"bananas": 1.85, "steak": 19.99, "cookies": 4.52, "celery": 2.81, "milk": 4.34}
Additionally,
If fewer than ten items are purchased, the price is the full cost per item.
If between ten and twenty items (inclusive) are purchased, the purchase gets a 5% discount.
If twenty-one or more items are purchased, the purchase gets a 10% discount.
Output the chosen item and total cost of the purchase to two decimal places. - CORRECT
ANSWER=>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))"
"Create a solution that accepts an integer input representing a 9-digit unformatted student
identification number. Output the identification number as a string with no spaces. - CORRECT
ANSWER=>student_id = int(input())
student_id_string = str(student_id)
first3 = student_id_string[0:3]
second2 = student_id_string[3:5]
third4 = student_id_string[5:]
print(f'{first3}-{second2}-{third4}')"
"Create a solution that accepts an integer input identifying how many shares of stock are to be
purchased from the Old Town Stock Exchange, followed by an equivalent number of string
inputs representing the stock selections. The following dictionary stock lists available stock
selections as the key with the cost per selection as the value.
stocks = {'TSLA': 912.86 , 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI': 6.92, 'KIRK': 8.72, 'AURA': 22.12,
'AMZN': 141.28, 'EMBK': 12.29, 'LVLU': 2.33}
Output the total cost of the purchased shares of stock to two decimal places. - CORRECT
ANSWER=>num_stock = int(input())
total_cost = 0
3|Page