We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Finding the percentage
Finding the percentage
Sort by
recency
|
3775 Discussions
|
Please Login in order to post a comment
if name == 'main': n = int(input()) student_marks = {} for _ in range(n): name, *line = input().split() scores = list(map(float, line)) student_marks[name] = scores query_name = input()
average = sum(student_marks[query_name])/len(student_marks[query_name]) print("%.02f"%average)
This code stub addresses a common programming problem effectively. Calculating the average of marks for a given student and formatting it to two decimal places is a practical exercise Ekbet9 id