Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. lemon_cups = float(input('Enter amount of lemon juice (in cups):\n'))
  2. water_cups = float(input('Enter amount of water (in cups):\n'))
  3. agave_cups = float(input('Enter amount of agave nectar (in cups):\n'))
  4. servings = float(input('How many servings does this make?\n'))
  5. print()
  6. print('Lemonade ingredients - yields {:.2f} servings' .format(servings))
  7. print('{:.2f} cup(s) lemon juice' .format(lemon_cups))
  8. print('{:.2f} cup(s) water' .format(water_cups))
  9. print('{:.2f} cup(s) agave nectar' .format(agave_cups))
  10. print()
  11. n_serving = float(input('How many servings would you like to make?\n'))
  12. print()
  13. print('Lemonade ingredients - yields {:.2f} servings' .format(n_serving))
  14. x = n_serving/servings
  15. lemon_cups = lemon_cups * x
  16. water_cups = water_cups * x
  17. agave_cups = agave_cups * x
  18. print('{:.2f} cup(s) lemon juice' .format(lemon_cups))
  19. print('{:.2f} cup(s) water' .format(water_cups))
  20. print( '{:.2f} cup(s) agave nectar' .format(agave_cups))
  21. print()
  22. print(Lemonade ingredients - yields {:.2f}
  23.  
  24. Lemonade ingredients - yields 48.00 servings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement