Python | Objective Assessment | Actual Questions
with Verified Answers | New 2025/2026 Update |
100% Correct.
Create a solution that accepts an integer input representing the
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
index value for any any of the five elements in the following list:
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
various_data_types = [516, 112.49, True, "meow", ("Western", i,- i,- i,- i,- i,- i,- i,-
"Governors", "University"), {"apple": 1, "pear": 5}] i,- i,- i,- i,- i,-
Using the built-in function type() and getting its name by using
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
the .name attribute, output data type (e.g., int", "float", "bool",
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
"str") based on the input index value of the list element.
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
The solution output should be in the format
i,- i,- i,- i,- i,- i,- i,-
Element index_value: data_type i,- i,- i,- i,-I_V = int(input())i,- i,-
if -1 <= I_V < len(various_data_types):
i,- i,- i,- i,- i,-
i,-element = various_data_types [I_V] i,- i,- i,-
D_T_N = str(type(element)).split("'")[1]
i,- i,-
print(f' Element {I_V}: {D_T_N}') i,- i,- i,-
, Create a solution that accepts three integer inputs representing
i,- i,- i,- i,- i,- i,- i,- i,- i,-
the number of times an employee travels to a job site. Output the
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
total distance traveled to two decimal places given the following
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
miles per employee commute to the job site. Output the total
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
distance traveled to two decimal places given the following miles
i,- i,- i,- i,- i,- i,- i,- i,- i,- i,-
per employee commute to the job site:
i,- i,- i,- i,- i,- i,-
Employee A: 15.62 miles i,- i,- i,-
Employee B: 41.85 miles i,- i,- i,-
Employee C: 32.67 miles i,- i,- i,-
The solution output should be in the format
i,- i,- i,- i,- i,- i,- i,-
Distance: total_miles_traveled i,- i,- i,-commute = { i,- i,-
i,-'Employee A': 15.62, i,- i,- i,-
i,-'Employee B': 41.85, i,- i,- i,-
i,-'Employee C': 32.67 i,- i,-
}
travels = { i,- i,-
i,-'Employee A': int(input()), i,- i,- i,-
i,-'Employee B': int(input()), i,- i,- i,-
i,-'Employee C': int(input()) i,- i,-
}