Advertisement
PowerCell46

Orders Python

Dec 23rd, 2022
778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. number_of_orders = int(input())
  2. all_sum = 0
  3. while True:
  4.     the_program_should_stop = False
  5.     number_of_orders -= 1
  6.     if number_of_orders == -1:
  7.         break
  8.     price_per_capsule = float(input())
  9.     if price_per_capsule < 0.01 or price_per_capsule > 100:
  10.         the_program_should_stop = True
  11.     days = int(input())
  12.     if days < 1 or days > 31:
  13.         the_program_should_stop = True
  14.     capsules_needed_for_a_day = int(input())
  15.     if capsules_needed_for_a_day < 1 or capsules_needed_for_a_day > 2000:
  16.         the_program_should_stop = True
  17.     if the_program_should_stop == True:
  18.         continue
  19.     result = price_per_capsule * capsules_needed_for_a_day * days
  20.     all_sum += result
  21.     print(f'The price for the coffee is: ${result:.2f}')
  22.  
  23. print(f'Total: ${all_sum:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement