-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgrades.py
More file actions
39 lines (28 loc) · 720 Bytes
/
grades.py
File metadata and controls
39 lines (28 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/python
from __future__ import print_function
import os
import sys
#
# Complete the gradingStudents function below.
#
def gradingStudents(grades):
#
# Write your code here.
#
for i in range(len(grades)):
if grades[i] >= 38:
value = grades[i]//5 + 1
if (value*5) - grades[i] < 3:
grades[i] = value*5
return grades
if __name__ == '__main__':
f = open(os.environ['OUTPUT_PATH'], 'w')
n = int(raw_input())
grades = []
for _ in xrange(n):
grades_item = int(raw_input())
grades.append(grades_item)
result = gradingStudents(grades)
f.write('\n'.join(map(str, result)))
f.write('\n')
f.close()