A library charges a fine for every book returned late. For first 5 days the fine is 50 paise, for 6-10 days fine is one rupee and above 10 days fine is 5 rupees. If you return the book after 30 days your membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine or the appropriate message.
This program is a simple program that calculates the fine amount for a library based on the number of days a book is overdue. The program takes an input from the user, the number of days the book is overdue and then uses conditional statements to determine the fine amount.
days = int(input("Enter the Number of Days :")) if (days>0 and days<= 5): amt = 0.50 * days print("Fine Amount Pay to Rs :", amt) elif(days >= 6 and days <= 10): amt = 1 * days print("Fine Amount Pay to Rs :", amt) elif (days > 10): amt = 5 * days print("Fine Amount Pay to Rs :", amt) if (days > 30): print("Your Membership would be Cancelled..") else: print("Invalid")
Enter the Number of Days :23 Fine Amount Pay to Rs : 115
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions