0

I would like some assistance into rounding off a answer in Python

fuel = 9.95
print("Initial Price is:",fuel)

tax = 0.095
fuelTax = (fuel * tax)
print(fuelTax)

I would like it that upon printing, the answer is rounded to x decimal places. As of right now, it prints out a float with a lot of decimal places. I just started learning how to code, and would appreciate any tips/pointers you guys have. Cheers :)

BruizehAF
  • 1
  • 1

1 Answers1

0

Use the builtin round(number, digits) function to obtain the expected result Bultin functions docs

salvatore
  • 511
  • 4
  • 11
  • Could you show me where to implement the function? I tried doing so but returned the error "int" object is not callable – BruizehAF Feb 02 '19 at 08:59