• + 2 comments

    new in python can u help me with this code

    #!/bin/python
    
    import sys
    
    def solve(grades):
        r=[]
        y=0
        d=0
        # Complete this function
        for i in range(0,len(grades)-1):
            if(grades[i]>=38):
                y=grades[i]/5
                d=5*(y+1)-grades[i]
                if(d<3):
                    r[i]=5*(y+1)
                else:
                    r[i]=grades[i]
            else:
                r[i]=grades[i]
        return r
                   
    
    n = int(raw_input().strip())
    grades = []
    grades_i = 0
    for grades_i in xrange(n):
        grades_t = int(raw_input().strip())
        grades.append(grades_t)
    result = solve(grades)
    print "\n".join(map(str, result))