Apr-26-2017, 05:30 AM
Hello everyone! :)
Can someone please explain to me what is wrong with my code? I need to give the total of the amount a user enters and show how much it is after 6% tax is added, but my program is not working correctly. Say for instance I enter the number 10, the result is 20. Thanks in advance for any help!
Can someone please explain to me what is wrong with my code? I need to give the total of the amount a user enters and show how much it is after 6% tax is added, but my program is not working correctly. Say for instance I enter the number 10, the result is 20. Thanks in advance for any help!
#!/usr/bin/env python3 tax = 0.06 def sales_tax(total): sales_tax = total * tax return total def main(): print("Sales Tax Calculator\n") total = float(input("Enter total: ")) total_after_tax = round(total + sales_tax(total), 2) print("Total after tax: ", total_after_tax) if __name__ == "__main__": main()