Created
September 17, 2013 21:09
-
-
Save go-ive/6600668 to your computer and use it in GitHub Desktop.
Reddit DailyProgrammer Challenge # 136 - Student Management
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nums = input().split() | |
num_students = int(nums[0]) | |
num_assignments = int(nums[1]) | |
students = [] | |
for i in range(0, num_students): | |
line = input() | |
student_avg = sum([float(x) for x in line.split()[1:num_assignments + 1]]) | |
students.append([line.split()[0], student_avg, student_avg / num_assignments]) | |
print("%.2f" % (float(sum([student[1] for student in students])) / (num_assignments * num_students))) | |
for item in students: | |
print(item[0], "%.2f" % item[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment