Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. import math
  2.  
  3. amount_bis_per_worker = int(input())
  4. workers = int(input())
  5. competing_factory = int(input())
  6.  
  7. sum_of_biscuits = 0
  8.  
  9. for day in range(30):
  10.     bis_per_day = workers * amount_bis_per_worker
  11.  
  12.     if day % 3 == 0:
  13.         bis_per_day *= 0.75
  14.  
  15.     sum_of_biscuits += bis_per_day
  16.  
  17. print(f"You have produced {math.floor(sum_of_biscuits)} biscuits for the past month.")
  18.  
  19. if sum_of_biscuits > competing_factory:
  20.     percentage = ((sum_of_biscuits - competing_factory) / competing_factory) * 100
  21.     print(f"You produce {percentage:.2f} percent more biscuits.")
  22. else:
  23.     percentage = ((competing_factory - sum_of_biscuits) / competing_factory) * 100
  24.     print(f"You produce {percentage:.2f} percent less biscuits.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement