DiYane

Orders

Jul 2nd, 2023 (edited)
1,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | Help | 0 0
  1. n = int(input())
  2. total_price = 0
  3.  
  4. for _ in range(n):
  5.     price_per_capsule = float(input())
  6.     days = int(input())
  7.     capsules_per_day = int(input())
  8.  
  9.     if 0.01 <= price_per_capsule <= 100.00 and 1 <= days <= 31 and 1 <= capsules_per_day <= 2000:
  10.         order_price = price_per_capsule * days * capsules_per_day
  11.         total_price += order_price
  12.         print(f"The price for the coffee is: ${order_price:.2f}")
  13.  
  14. print(f"Total: ${total_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment