Preparing git repo for final project
This commit is contained in:
14
problems/pset2/nutrition/nutrition.py
Normal file
14
problems/pset2/nutrition/nutrition.py
Normal file
@@ -0,0 +1,14 @@
|
||||
fruits = {'apple': '130', 'avocado': '50', 'banana': '110', 'cantaloupe': '50',
|
||||
'grapefruit': '60', 'grapes': '90', 'honeydew melon': '50', 'kiwifruit': '90', 'lemon': '15', 'lime': '20',
|
||||
'nectarine': '60', 'orange': '80', 'peach': '60', 'pear': '100', 'pineapple': '50', 'plums': '70', 'strawberries': '50',
|
||||
'sweet cherries': '100', 'tangerine': '50', 'watermelon': '80'}
|
||||
|
||||
|
||||
def main():
|
||||
fruit = input("Item:\t\t").lower()
|
||||
if fruit in fruits:
|
||||
print(f"Calories:\t\t{fruits[fruit]}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user