Why does it have to be 15.0/100?



I'm not stuck but I tried to get the 15% into a percentage form and when I typed 15/100 it didn't work. I was just wondering why I needed to include the .0 at the end.

# You're almost there! Assign the tip variable on line 5.

meal = 44.50
tax = 0.0675
tip = 15.0/100


because in python2, dividing two integers gives a integer as result. so 15 / 100 would simply be zero, because the number is floored

dividing a float and a integers gives an float as result.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.