The U.S. Food & Drug Adminstration (FDA)
CS50 Python , Nutrition Facts |
This post is meant for learners of CS50 Introduction to Programming with Python, Week 2 Loops, Problem Set 2 name "Nutrition Facts". This table can be easily copied to the code editor of your choice.
Table as List of Dictionaries:
fruits = [
{'name': 'Apple', 'calories': 130},
{'name': 'Avocado', 'calories': 50},
{'name': 'Banana', 'calories': 110},
{'name': 'Cantaloupe', 'calories': 50},
{'name': 'Grapefruit', 'calories': 60},
{'name': 'Grapes', 'calories': 90},
{'name': 'Honeydew Melon', 'calories': 50},
{'name': 'Kiwifruit', 'calories': 90},
{'name': 'Lemon', 'calories': 15},
{'name': 'Lime', 'calories': 20},
{'name': 'Nectarine', 'calories': 60},
{'name': 'Orange', 'calories': 80},
{'name': 'Peach', 'calories': 60},
{'name': 'Pear', 'calories': 100},
{'name': 'Pineapple', 'calories': 50},
{'name': 'Plums', 'calories': 70},
{'name': 'Strawberries', 'calories': 50},
{'name': 'Sweet Cherries', 'calories': 100},
{'name': 'Tangerine', 'calories': 50},
{'name': 'Watermelon', 'calories': 80}
]
Video tutorial on the problem set will be posted soon ...
0 Comments
Your opinion matters, your voice makes us proud and happy. Your words are our motivation.