Skip to content

Commit 677b151

Browse files
authored
nutrition.py code
1 parent f364b8d commit 677b151

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

week2/nutrition/nutrition.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
fruit = input("Input: ").lower()
2+
3+
list = {
4+
"apple": 130,
5+
"avocado": 50,
6+
"banana": 110,
7+
"cantaloupe": 50,
8+
"grapefruit": 60,
9+
"grapes": 60,
10+
"honeydew melon": 50,
11+
"kiwifruit": 90,
12+
"lemon": 15,
13+
"lime": 20,
14+
"nectarine": 60,
15+
"orange": 80,
16+
"peach": 60,
17+
"pear": 100,
18+
"pineapple": 50,
19+
"plums": 70,
20+
"strawberries": 50,
21+
"sweet cherries": 100,
22+
"tangerine": 50,
23+
"watermelon": 80
24+
}
25+
26+
if fruit in list:
27+
print(f"Calories: {list[fruit]}")

0 commit comments

Comments
 (0)