Created
June 14, 2021 19:52
-
-
Save joshlawrence/e8229cc992c2c4add76c769fd8fa0e5a to your computer and use it in GitHub Desktop.
Ashley's Homework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# get the amounts of each ingredient | |
lemon_juice_cups = float(input('Enter amount of lemon juice (in cups)')) | |
water_cups = float(input('Enter amount of water (in cups)')) | |
agave_nec_cups = float(input('Enter amount of agave nectar (in cups)')) | |
num_servings = float(input('How many servings does this make?')) | |
# print the amounts formatted to 2 decimal places | |
print('Lemonade ingredients - yields', '{:.2f}'.format(num_servings), 'servings') | |
print('{:.2f}'.format(lemon_juice_cups, 'cup(s) lemon juice')) | |
print('{:.2f}'.format(water_cups, 'cup(s) water')) | |
print('{:.2f}'.format(agave_nec_cups, 'cup(s) agave nectar')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment