Guest User

Untitled

a guest
Jan 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. from cisc106_32 import*
  2.  
  3. def BillAmount(mb):
  4.  
  5.  
  6. if mb <= 50:
  7. price=50
  8.  
  9. elif 50<mb<=400:
  10. price=(66.50+(.05)(mb-50.00))
  11.  
  12. elif 400<mb<=1000:
  13. price=(72.00+(.08)(mb-50.00))
  14.  
  15. else:
  16. price=100.00
  17.  
  18. return price
  19.  
  20. assertEqual(BillAmount(45),50)
  21.  
  22. assertEqual(BillAmount(400),84)
  23.  
  24. assertEqual(BillAmount(2000),100)
  25.  
  26. result = (0.5) * (mb - 50.00)
  27.  
  28. (.05)(mb-50.00)
  29.  
  30. (.05) * (mb-50.00)
  31.  
  32. >>> mb=51
  33. >>> (.05)(mb-50.00)
  34. Traceback (most recent call last):
  35. File "<stdin>", line 1, in <module>
  36. TypeError: 'float' object is not callable
  37. >>> (.05)*(mb-50.00)
  38. 0.050000000000000003
Add Comment
Please, Sign In to add comment