Finding the Percentage – HackerRank | Solution | Full Explained

Finding the Percentage – HackerRank | Solution | Full Explained

Here I am going to share Finding the Percentage – HackerRank Solution with you. Hope you understand everything. visit the question: [Click Here]

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

    query_marks = student_marks[query_name]

    print("{:.2f}".format(float(sum(query_marks))/len(query_marks)))

print(“{:.2f}”.format(float(sum(query_marks))/len(query_marks))) to know about more about the string formating.

Leave a Reply

Your email address will not be published. Required fields are marked *