Advertisement
ALEXANDAR_GEORGIEV

dishwasher_nee_moe

Jun 7th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. detergent = int(input())
  2. detergent_ml = detergent * 750
  3. wash_count = 0
  4. dishes_count = 0
  5. pot_count = 0
  6. no_more_detergent = False
  7. command = input()
  8. while command != "End":
  9.     dishes = int(command)
  10.     wash_count += 1
  11.     if wash_count % 3 == 0:
  12.         detergent_ml -= dishes * 15
  13.         pot_count += dishes
  14.     else:
  15.         detergent_ml -= dishes * 5
  16.         dishes_count += dishes
  17.     if detergent_ml < 0:
  18.         no_more_detergent = True
  19.         break
  20.     command = input()
  21. if no_more_detergent:
  22.     print(f"Not enough detergent, {abs(detergent_ml)} ml. more necessary!")
  23. else:
  24.     print("Detergent was enough!")
  25.     print(f"{dishes_count} dishes and {pot_count} pots were washed.")
  26.     print(f"Leftover detergent {detergent_ml} ml.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement