I am trying to make a code so that the amount of Books will decide on each statements' usage. So if I write 20, the expected answer should be 95, instead it's 100. That means elif is being ignored, and is only doing the if statement (other than the negative elif statement). How can I rewrite the code so that it doesn't ignore the Book > 10 and Book > 20 elif statements?
try:
book = raw_input('Enter amount of Books:\n')
Book = int(book)
red = Book - 10
if Book > 0:
print int(book) * 5
elif Book > 10:
print (red * 4.5) + (10 * 5)
elif Book < 0:
print ('Amount cannot be negative.')
elif Book > 20:
print (10 * 5) + (10 * 4.5) + (int(book) - 20 ) * 4
else:
print ('There has been a mistake. Please restart.')
except:
print ('Error.')