Answered You can hire a professional tutor to get the answer.

QUESTION

The first function you will write should be called 'whatTypes'. Your function should take one (1) argument, a list.

The first function you will write should be called 'whatTypes'.

Your function should take one (1) argument, a list. The function should return one (1) list containing the data types of each of the members of the list passed to the function. To obtain the data type, use the built-in type function discussed in class. Your return list should contain the entire output of the type function for each element.

For example if you call: type('a'), you will receive as output. This is what you would place in your list.

Make sure to maintain the proper ordering, so that the zeroth element of your return list corresponds to the zeroth element of the input list, etc.

Example Test Case: whatTypes(['a', 2, 4.3]) returns [<class 'str'>, class 'int>, <class 'float'>]

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question