Advertisement
Yashov

Untitled

Jan 14th, 2023
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. number_of_orders = int(input())
  2.  
  3. total_price = 0
  4. for _ in range(number_of_orders):
  5.     price_capsule = float(input())
  6.     days = int(input())
  7.     capsule = int(input())
  8.  
  9.     if price_capsule < 0.01 or price_capsule > 100:
  10.         continue
  11.  
  12.     if days < 1 or days > 31:
  13.         continue
  14.  
  15.     if capsule < 1 or capsule > 2000:
  16.         continue
  17.  
  18.     order_price = price_capsule * days * capsule
  19.     total_price += order_price
  20.  
  21.     print(f"The price for the coffee is: ${order_price:.2f}")
  22.  
  23. print(f"Total: ${total_price:.2f}")
Tags: Orders
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement