BbJLeB

08. Cookie factory

Jun 3rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. # 08. Cookie factory
  2.  
  3. n = int(input())
  4.  
  5. for batch in range(1, n+1):
  6.     eggs = False
  7.     flour = False
  8.     sugar = False
  9.  
  10.     while True:
  11.         products = input()
  12.         if products == "Bake!":
  13.             if eggs and flour and sugar:
  14.                 print(f"Baking batch number {batch}...")
  15.                 break
  16.             else:
  17.                 print(f"The batter should contain flour, eggs and sugar!")
  18.  
  19.         if products == "eggs":
  20.             eggs = True
  21.         elif products == "flour":
  22.             flour = True
  23.         elif products == "sugar":
  24.             sugar = True
Add Comment
Please, Sign In to add comment