Created
December 31, 2017 12:35
-
-
Save amulyakashyap09/c13f64aa631d3984187f76b7da5b927c to your computer and use it in GitHub Desktop.
Find the percentage | Hackerrank
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
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() | |
marks_list = student_marks.get(query_name) | |
a = sum(marks_list)/len(marks_list) | |
print("%.2f" % a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment