• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Pancake station

a guest Mar 26th, 2020 67 in 1 day
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. # Minimal amounts of ingredients
2. eggsMin: int = 1
3. milkMin: int = 200
4. flourMin: int = 100
5.
6. # Input amounts
7.
8. print ("How many eggs do you have?")
9. eggs = int(input())
10.
11. print ("How much milk do you have? (in milliliters)")
12. milk = int(input())
13.
14. print ("How much flour do you have? (in grams)")
15. flour = int(input())
16.
17. print("You have", milk, "ml of milk,", eggs," eggs and", flour, "g of flour.")
18.
19. # Can we make pancake?
20.
21. if eggs >= eggsMin and milk >= milkMin and flour >= flourMin:
22.     print("Pancake time!")
23. else:
24.     print("Sorry, not enough")
25.
26. # How many can we cook?
27.
28. eggsPortions = eggs / eggsMin
29. milkPortions = milk / milkMin
30. flourPortions = flour / flourMin
31.
32. portions = [eggsPortions, milkPortions, flourPortions]
33. potentialPancakes = min(portions)
34. print("You can make " + str(int(potentialPancakes * 4)) + " pancakes!")
35. print("You will need:" + str(eggsMin * potentialPancakes) + " eggs, " + str(milkMin * potentialPancakes) + "ml of milk and " + str(flourMin * potentialPancakes) + "g of flour.")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Top