>>> price_plus_tax(100, 0.25) 125.0 >>> price_plus_tax(125.50, 0.05) 131.775
(price: float, tax_rate: float)
| 4 | |
| 5 | |
| 6 | def 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 | |
| 16 | if __name__ == "__main__": |