Code Coach: Kaleidoscope
Task description (for non-pro users) You sell souvenir kaleidoscopes at a gift shop, and if a customer buys more than one, they get a 10% discount on all of them! Given the total number of kaleidoscopes that a customer buys, let them know what their total will be. Tax is 7%. All of your kaleidoscopes cost the same amount, 5.00. Task: Take the number of kaleidoscopes that a customer buys and output their total cost including tax and any discounts. Input Format: An integer value that represents the number of kaleidoscopes that a customer orders. Output Format: A number that represents the total purchase price to two decimal places. =================================== My submission: a=gets.chomp.to_i if a==1 print ((5.00*1.07)).round(2) else puts ((a*4.50*1.07)).round(2) end Only 1 test case fails while a similar approach in Python works. Why?