Find the Percentage from HackerRank
For a beginner this is some good code. I would make some additional adjustments.


One-line docstrings should be on one line, not over 3. And should end with a period.
You should only pass the marks to percentage and not rely on a global student_marks.
You can use sum to compute total_marks.
I'm not a fan of having format in the percentage function.
You should move all the main code into a main function, if __name__ == '__main__': should really only call this.
It's more idiomatic to use comprehensions than map, even more so when you have list(map(...)).
It's pretty rude to call a student a query. You can just use name.


def percentage(marks):
    """Find percentage of marks of the student."""
    return sum(marks) / len(marks)


def main():
    """Main code."""
    n = int(input())
    student_marks = {}
    for _ in range(n):
        name, *scores = input().split()
        student_marks[name] = [float(score) for score in scores]
    name = input()
    result = percentage(student_marks[name])
    print(format(result, '.2f'))


if __name__ == '__main__':
    main()



You can use statistics.mean rather than a custom made percentage.
You can change the for loop into two comprehensions, a generator and dictionary comprehension.

Note: I don't think comprehensions are better here, but are an 'as good' alternate.


import statistics


def main():
    """Main code."""
    _marks = (input().split() for _ in range(int(input())))
    student_marks = {
        name: [float(score) for score in scores]
        for name, *scores in _marks
    }
    result = statistics.mean(student_marks[input()])
    print(format(result, '.2f'))


if __name__ == '__main__':
    main()