Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lemon_cups = float(input('Enter amount of lemon juice (in cups):\n'))
- water_cups = float(input('Enter amount of water (in cups):\n'))
- agave_cups = float(input('Enter amount of agave nectar (in cups):\n'))
- servings = float(input('How many servings does this make?\n'))
- print()
- print('Lemonade ingredients - yields {:.2f} servings' .format(servings))
- print('{:.2f} cup(s) lemon juice' .format(lemon_cups))
- print('{:.2f} cup(s) water' .format(water_cups))
- print('{:.2f} cup(s) agave nectar' .format(agave_cups))
- print()
- n_serving = float(input('How many servings would you like to make?\n'))
- print()
- print('Lemonade ingredients - yields {:.2f} servings' .format(n_serving))
- x = n_serving/servings
- lemon_cups = lemon_cups * x
- water_cups = water_cups * x
- agave_cups = agave_cups * x
- print('{:.2f} cup(s) lemon juice' .format(lemon_cups))
- print('{:.2f} cup(s) water' .format(water_cups))
- print( '{:.2f} cup(s) agave nectar' .format(agave_cups))
- print()
- print(Lemonade ingredients - yields {:.2f}
- Lemonade ingredients - yields 48.00 servings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement