-2

New to programming and I'm currently trying to solve a problem at bootcamp where I have to calculate the discounted amount of a book order totaling 55 books and discount of shipment fee of $3 for the first book and 75 cents for the rest. https://i.stack.imgur.com/1HxaO.jpg The answer I always get is 866.85 but the answer was supposed to be 866.8499999999999 and I have no idea how to solve it.

Really appreciate any clarifications on what I did wrong on this one!

HoneyRock
  • 1
  • 1

1 Answers1

0

maybe you're using round function with 2 decimal place

round(34.5646452,3) gives you 34.564 as output if you want high accuracy in decimal place just remove he round function and you code should run fine