-
Python HackerRank : Grading StudentsPrograming Language/Python 2020. 8. 1. 00:15반응형
문제
- 40 점 이하는 탈락
- 하지만 점수 차이가 2점 이하이면 십의 자리에서 반 올림해줌.
- 0<점수<=100
def gradingStudents(grades): # Write your code here for i in range(len(grades)): if grades[i] > 37 and grades[i] < 100: if (grades[i]//5 + 1)*5 - grades[i] < 3 and (grades[i]//5 + 1)*5 - grades[i] > 0: grades[i] = (grades[i]//5 + 1)*5 return grades
반응형'Programing Language > Python' 카테고리의 다른 글
자료구조와 알고리즘 (0) 2020.08.10 Python HackerRank : Forming a Magic Square (0) 2020.08.07 Python HackerRank : Time Conversion (0) 2020.07.31 Python HackerRank : Plus Minus (0) 2020.07.31 Python HackerRank : Diagonal Difference (0) 2020.07.31