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.
#!/bin/python3importmathimportosimportrandomimportreimportsys## Complete the 'libraryFine' function below.## The function is expected to return an INTEGER.# The function accepts following parameters:# 1. INTEGER d1# 2. INTEGER m1# 3. INTEGER y1# 4. INTEGER d2# 5. INTEGER m2# 6. INTEGER y2#deflibraryFine(d1,m1,y1,d2,m2,y2):ify1>y2:return10000elify1<y2:return0ifm1>m2:return(m1-m2)*500elifm1<m2:return0ifd1>d2:return(d1-d2)*15else:return0if__name__=='__main__':fptr=open(os.environ['OUTPUT_PATH'],'w')first_multiple_input=input().rstrip().split()d1=int(first_multiple_input[0])m1=int(first_multiple_input[1])y1=int(first_multiple_input[2])second_multiple_input=input().rstrip().split()d2=int(second_multiple_input[0])m2=int(second_multiple_input[1])y2=int(second_multiple_input[2])result=libraryFine(d1,m1,y1,d2,m2,y2)fptr.write(str(result)+'\n')fptr.close()
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 →