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.
def libraryFine(d1, m1, y1, d2, m2, y2):
fine = 0
if d1d2 and m1==m2 and y1==y2:
fine = 15 * (d1-d2)
elif m1>m2 and y1==y2:
fine = 500 * (m1-m2)
elif y1!=y2 and y1>y2:
fine = 10000
return fine
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Library Fine
You are viewing a single comment's thread. Return to all comments →
def libraryFine(d1, m1, y1, d2, m2, y2): fine = 0 if d1d2 and m1==m2 and y1==y2: fine = 15 * (d1-d2) elif m1>m2 and y1==y2: fine = 500 * (m1-m2) elif y1!=y2 and y1>y2: fine = 10000