Question: 3. Write a function, calcPerc(lst) which takes the elements of a list, calculates their total (excluding non-numerics), and creates a new list with their percentages

3. Write a function, calcPerc(lst) which takes the elements of a list, calculates their total (excluding non-numerics), and creates a new list with their percentages as shown below. If the percentage is less than 50%, an * is placed next to it in the list. If the list is empty, an * is placed in the first position in the list. A separate list is kept of each non-numeric. You must use a try/except to check for non-numerics, raise the less than .5 exception and raise the empty list exception. This program returns a list with the first element being the list of non-numerics, and the second element being the percentages. See below for sample output.

3. Write a function, calcPerc(lst) which takes the elements of a list, This is what the output should look like and in python please

>>calcPerc(C1,2,3,0]) * I >>>calcPerc([] >calcPerc(C'a','b', c']

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!