LinkedIn Python Skill Assessment Quiz Answers

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

Latest Update on 24th January, 2022 by Certification Course Answers

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

  1.  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
  2.  def tx(amt): '''Gets the tax on an amount.'''
  3.  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.'''
  4.  def calculate_sales_tax(subtotal): pass

Correct Answer:

  •  def calculate_sales_tax(subtotal): pass

Latest Updates

No posts found in this category.