We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defgradingStudents(grades):#definesfunctionfinal_grades=[]#createsalistforstoringthefinalgradesforiingrades:# if it is lower than 38, just print itself, no changesifi<38:final_grades.append(i)# if 'i % 5' bigger than '2'elifi%5>2:i+=(5-i%5)# sums to 'i', ex: i=48# 48%5 == 3 | 3 > 2# 48 += (5-3) | '50'final_grades.append(i)else:final_grades.append(i)return(final_grades)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
Python