• API
• FAQ
• Tools
• Archive
SHARE
TWEET # Python Code a guest Nov 14th, 2019 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. amount_of_biscuits_per_worker = input() #78
2. count_of_workers = input() #8
3. enemy_fac_total_production = input() #16000
4.
5. if amount_of_biscuits_per_worker.isdigit() and count_of_workers.isdigit() and enemy_fac_total_production.isdigit():
6.     if int(amount_of_biscuits_per_worker) < 1 or int(amount_of_biscuits_per_worker) > 200:
8.     elif int(count_of_workers) < 1 or int(count_of_workers) > 1000:
10.     elif int(enemy_fac_total_production) < 1 or int(enemy_fac_total_production) > 2000000:
12.     else:
13.         amount_of_biscuits_per_worker = int(amount_of_biscuits_per_worker)
14.         count_of_workers = int(count_of_workers)
15.         enemy_fac_total_production = int(enemy_fac_total_production)
16.
17.         #Production of my factory for a day:
18.         def production_factory_day(amount_of_biscuits_per_worker, count_of_workers):
19.             production_my_factory_one_day = amount_of_biscuits_per_worker * count_of_workers
20.             return production_my_factory_one_day
21.
22.         #X is now Production of my factory for one day:
23.         x = (production_factory_day(amount_of_biscuits_per_worker, count_of_workers))
24.
25.         #Production of my Factory for the last 30 days:
26.         my_fac_total_production = (x * 0.75) * 10 + x * 20
27.
28.         diffrence_between_facs = my_fac_total_production - enemy_fac_total_production
29.
30.         print("You have produced " + str(int(my_fac_total_production)) + " biscuits for the past month.")
31.
32.
33.         if diffrence_between_facs < 0:
34.             n = diffrence_between_facs * - 1
35.             a = (n / enemy_fac_total_production) * 100
36.             print("You produce " + str("%.2f" % round(a, 2)) + " percent less biscuits.")
37.
38.         elif diffrence_between_facs > 0:
39.             b = (diffrence_between_facs / enemy_fac_total_production) * 100
40.             print("You produce " + str("%.2f" % round(b, 2)) + " percent more biscuits.")
41. else: