Question: Create a solution that accepts an integer input representing the index value for any any of the five elements in the following list: various _
Create a solution that accepts an integer input representing the index value for any any of the five elements in the following list:
variousdatatypes True, "meow", Western "Governors", "University"apple: "pear":
Using the builtin function type and getting its name by using the name attribute, output data type eg intfloatboolstr based on the input index value of the list element.
The solution output should be in the format
Element indexvalue: datatype
Sample InputOutput:
If the input is
then the expected output is
Element : tuple
variousdatatypes True, "meow", Western "Governors", "University"apple: "pear":
#use builtin function type
#get name by using the builtin attribute name
#solution accepts integer input representing list element index
#solution outputs data type of list element based on input index value
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
