Skip to content

Instantly share code, notes, and snippets.

@go-ive
Created September 17, 2013 21:09
Show Gist options
  • Save go-ive/6600668 to your computer and use it in GitHub Desktop.
Save go-ive/6600668 to your computer and use it in GitHub Desktop.
Reddit DailyProgrammer Challenge # 136 - Student Management
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