• + 0 comments

    print(f"{sum(student_marks[query_name])/3:.2f}")

    length 3 is fixed. You could just hard code it.