MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / price_plus_tax

Function price_plus_tax

financial/price_plus_tax.py:6–13  ·  view source on GitHub ↗

>>> price_plus_tax(100, 0.25) 125.0 >>> price_plus_tax(125.50, 0.05) 131.775

(price: float, tax_rate: float)

Source from the content-addressed store, hash-verified

4
5
6def price_plus_tax(price: float, tax_rate: float) -> float:
7 """
8 >>> price_plus_tax(100, 0.25)
9 125.0
10 >>> price_plus_tax(125.50, 0.05)
11 131.775
12 """
13 return price * (1 + tax_rate)
14
15
16if __name__ == "__main__":

Callers 1

price_plus_tax.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected