Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question-3: Write a Python function named calc_mark() that takes a students individual quiz marks out of 10 in a string separated by a comma &

Question-3: Write a Python function named calc_mark() that takes a students individual quiz marks out of 10 in a string separated by a comma & multiple spaces. The function then calculates & returns his/her final quiz mark. You can assume the minimum number of quizzes taken is 2. Lets say, there were a total n number of quizzes taken. The final quiz mark will be calculated as follows: If n equals or less than 3, then final_mark = average mark of best (n-1) quizzes Otherwise, final_mark = average mark of best (n-2) quizzes [You are not allowed to use built-in functions sum(), max(), min() to solve this problem.] ================================================ Function Call 1: calc_mark("7 , 9 , 6 , 8 , 7") Sample Output 1: Given marks: [7, 9, 6, 8, 7] 8.0 Explanation 1: Since the total number of quizzes is greater than 3, the final mark will be: (9 + 8 + 7) / 3 = 8.0 which will be returned and printed in the function call. ================================================ Function Call 2: calc_mark("10 , 6 , 8") Sample Output 2: Given marks: [10, 6, 8] 9.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago