Advertisement
Guest User

Untitled

a guest
May 5th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def excluding_vat_price(price):
  2. vatPrice = ((price * 15) / 115)
  3. priceWithoutVat = price - vatPrice
  4. return -1 if price == 0 else round(priceWithoutVat, 2)
  5.  
  6. Traceback (most recent call last):
  7. File "tests.py", line 14, in <module>
  8. test.assert_equals(excluding_vat_price(None), -1)
  9. File "/workspace/default/solution.py", line 5, in excluding_vat_price
  10. vatPrice = ((price * 15) / 115)
  11. TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement