# Write a function in python which accept a list of marks of students and return the# minimum mark, maximum mark and the average marks. Use the same function to test
Question
Write a function in python which accept a list of marks of students and return the# minimum mark, maximum mark and the average marks. Use the same function to test
🧐 Not the exact question you are looking for?Go ask a question
Solution
Sure, here is a Python function that accepts a list of student marks and returns the minimum mark, maximum mark, and the average mark:
def marks_analysis(marks):
min_mark = min(marks)
max_mark = max(marks)
avg_mark = sum(marks) / len(marks)
return min_mark, max_mark, avg_mark
# Testing the function
marks = [85, 90, 78, 92, 88, 76, 95, 89]
print(marks_analysis(marks))
In this function, min(marks) is used to find the minimum mark, max(marks) is used to find the maximum mark, and sum(marks) / len(marks) is used to calculate the average mark. The function returns these three values.
The function is then tested with a list of marks. The print statement will output the minimum mark, maximum mark, and average mark of the list of marks.
Similar Questions
0/0
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.