Question: Evaluation Question 3: Write a descriptive length function quiz_length() that calculates the length of a list in a different way: The length of a list
Evaluation Question 3: Write a descriptive length function quiz_length() that calculates the length of a list in a different way: The length of a list is the sum of the number of characters and digits that are possessed by the elements of the list. For example, the list (12.0, "ab") has the length 5 since 12 has two digits. O has one digit and "ab" has two characters. The function should return integer value for the given list. For example, after implementing the function and running following code, sample_value should be equal to 5; L = [12.0,"ab") sample_value = quiz_length (L)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
