• + 0 comments

    Python

    def libraryFine(d1, m1, y1, d2, m2, y2):
        # Write your code here
        ydiff = y1-y2
        if ydiff>=1:
            return 10000*ydiff
        elif ydiff<=-1:
            return 0
            
        else:
             mdiff = m1-m2
             if mdiff>=1:
                return 500*mdiff
             elif mdiff<=-1:
                return 0
             else:
                ddiff= d1-d2
                if ddiff>=1:
                    return 15*ddiff
                elif ddiff<=-1:
                    return 0
                else:
                    return 0