Advertisement
GabrielaBo

fruit_shop

Oct 2nd, 2019
1,018
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. fruit = input().lower()
  2. day = input().lower()
  3. quantity = float(input())
  4.  
  5. price = 0
  6. if "Monday" == day or "Tuesday" == day or "Wednesday" == day\
  7. or "Thursday" == day or "Friday" == day:
  8. if "banana" == fruit:
  9. price = 2.50
  10. elif "apple" == fruit:
  11. price = 1.20
  12. elif "orange" == fruit:
  13. price = 0.85
  14. elif "grapefruit" == fruit:
  15. price = 1.45
  16. elif "kiwi" == fruit:
  17. price = 2.70
  18. elif "pineapple" == fruit:
  19. price = 5.50
  20. elif "grapes" == fruit:
  21. price = 3.85
  22.  
  23. elif "Saturday" == day or "Sunday" == day:
  24. if "banana" == fruit:
  25. price = 2.70
  26. elif "apple" == fruit:
  27. price = 1.25
  28. elif "orange" == fruit:
  29. price = 0.90
  30. elif "grapefruit" == fruit:
  31. price = 1.60
  32. elif "kiwi" == fruit:
  33. price = 3.00
  34. elif "pineapple" == fruit:
  35. price = 5.60
  36. elif "grapes" == fruit:
  37. price = 4.20
  38.  
  39. if price == 0:
  40. print("error")
  41. else:
  42. price = price * quantity
  43. print(f'{price:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement