There was an error while loading. Please reload this page.
1 parent a2b103a commit 99919a9Copy full SHA for 99919a9
implementation/grading-students.py
@@ -0,0 +1,38 @@
1
+# https://www.hackerrank.com/challenges/grading/problem
2
+
3
4
+#!/bin/python3
5
6
+import os
7
+import sys
8
9
+#
10
+# Complete the gradingStudents function below.
11
12
+def gradingStudents(grades):
13
+ new_grades = []
14
+ for grade in grades:
15
+ if grade >= 38 and grade % 5 >= 3:
16
+ grade = grade + (5 - grade % 5)
17
+ new_grades.append(grade)
18
19
+ return new_grades
20
21
22
+if __name__ == '__main__':
23
+ f = open(os.environ['OUTPUT_PATH'], 'w')
24
25
+ n = int(input())
26
27
+ grades = []
28
29
+ for _ in range(n):
30
+ grades_item = int(input())
31
+ grades.append(grades_item)
32
33
+ result = gradingStudents(grades)
34
35
+ f.write('\n'.join(map(str, result)))
36
+ f.write('\n')
37
38
+ f.close()
0 commit comments