Skip to content

Instantly share code, notes, and snippets.

@blitzblade
Created November 17, 2022 22:14
Show Gist options
  • Save blitzblade/3558b86fdd1baeef7a65ad400e4ec13b to your computer and use it in GitHub Desktop.
Save blitzblade/3558b86fdd1baeef7a65ad400e4ec13b to your computer and use it in GitHub Desktop.
gradingsystem.py
def gradingStudents(grades):
# Write your code here
def roundd(grade):
if grade >= 38:
int_part = grade // 10 #64/10
remainder = grade % 10
if remainder >= 8:
return int_part*10 + 10
elif 5 >= remainder >= 3:
return int_part*10 + 5
return grade
result = [roundd(grade) for grade in grades]
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment