Skip to content

Instantly share code, notes, and snippets.

@amulyakashyap09
Created December 31, 2017 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amulyakashyap09/c13f64aa631d3984187f76b7da5b927c to your computer and use it in GitHub Desktop.
Save amulyakashyap09/c13f64aa631d3984187f76b7da5b927c to your computer and use it in GitHub Desktop.
Find the percentage | Hackerrank
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