HackerRank Solution: Finding the Percentage

Sakshi Singh
1 min readApr 3, 2019

--

(IN PYTHON3)

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()

l = list(student_marks[query_name])

no = len(l)

s = sum(l)

ss = s/no

print(“%.2f” % ss)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Sakshi Singh
Sakshi Singh

Responses (2)

Write a response