What is the most self-descriptive way to define a function that calculates sales tax on a purchase?

  • def tax(my_float):
    ”Calculates the sales tax of a purchase. Takes in a float representing the subtotal as an argument and returns a float representing the sales tax.”
    pass
  • def tx(amt):
    ”Gets the tax on an amount.”
  • def sales_tax(amount):
    ”Calculates the sales tax of a purchase. Takes in a float representing the subtotal as an argument and returns a float representing the sales tax.”
  • def calculate_sales_tax(subtotal):
    pass
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend