JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Tony's Grossery 👹
Share
Explore
Gallery
Solution Tony's Grossery 👹
Solution Tony's Grossery 👹
Solution
The Task
Stage 1
Stage 2
Python Starter Code
Code Clips
Solution
Solution
solution
# Tony's Grossery
# array of strings used to store list of products
productList
=
[
'Juice - Happy Planet'
,
'Edible Flower - Mixed'
,
'Turkey - Mince'
,
'Spinach - Packaged'
,
'Muffin - Banana Nut Individual'
,
'Wine - Jafflin Bourgongone'
,
'Mustard - Individual Pkg'
,
'Beer - Sleemans Cream Ale'
,
'Potatoes - Mini Red'
,
'Venison - Racks Frenched'
,
'Longos - Burritos'
,
'Milk - Chocolate 500ml'
,
'Yucca'
,
'Chilli Paste, Sambal Oelek'
,
'Soup - Campbells Beef Stew'
,
'Mikes Hard Lemonade'
,
'Remy Red Berry Infusion'
,
'Galliano'
,
'Long Island Ice Tea'
,
'Olives - Nicoise'
,
'White Fish - Filets'
,
'Vinegar - Raspberry'
,
'Quinoa'
,
'Coffee Decaf Colombian'
,
'Wine - Pinot Noir Mondavi Coastal'
,
'Scampi Tail'
,
'Soup Campbells - Tomato Bisque'
,
'Vinegar - White Wine'
,
'Coffee Cup 12oz 5342cd'
,
'Wine - Shiraz Wolf Blass Premium'
,
'Corn - Mini'
,
'Orange Roughy 6/8 Oz'
,
'Water - San Pellegrino'
,
'Banana - Leaves'
,
'Creme De Banane - Marie'
,
'Juice - Clamato, 341 Ml'
,
'Chicken - Wings, Tip Off'
,
'Honey - Comb'
,
'Grapefruit - White'
,
'Food Colouring - Red'
,
'Wine - White, Riesling, Henry Of'
,
'Yogurt - Raspberry, 175 Gr'
,
'Juice - Lime'
,
'Tomatoes - Grape'
,
'Cheese - Gorgonzola'
,
'Wanton Wrap'
,
'Burger Veggie'
,
'Juice - Orange 1.89l'
,
'Food Colouring - Orange'
,
'Bag - Bread, White, Plain'
,
'Sea Urchin'
,
'Butter - Unsalted'
,
'Coffee - Almond Amaretto'
,
'Cheese - Brie'
,
'Bread - Multigrain Oval'
,
'Sprouts - Bean'
,
'Wine - Alsace Riesling Reserve'
,
'Clam Nectar'
,
'Wine - Merlot Vina Carmen'
,
'Pecan Raisin - Tarts'
,
'Ecolab - Balanced Fusion'
,
'Otomegusa Dashi Konbu'
,
'Crab - Soft Shell'
,
'Mushroom - Chanterelle, Dry'
,
'Energy Drink'
,
'Coffee Guatemala Dark'
,
'Beef Wellington'
,
'Trueblue - Blueberry Cranberry'
,
'Hog / Sausage Casing - Pork'
,
'Tomatoes'
,
'Wine - White, Pinot Grigio'
,
'French Pastries'
,
'Pasta - Cheese / Spinach Bauletti'
,
'Chicken Breast Halal'
,
'Mousse - Mango'
,
'Bar Bran Honey Nut'
,
'Bread - Pullman, Sliced'
,
'Cheese - Le Cheve Noir'
,
'Onion Powder'
,
'Rice - Aborio'
,
'Figs'
,
'Olive - Spread Tapenade'
,
'Dikon'
,
'Nantucket Orange Juice'
,
'Juice - Orange'
,
'Duck - Whole'
,
'Oil - Truffle, White'
,
'Wine - Magnotta - Cab Franc'
,
'Table Cloth 144x90 White'
,
'Crab - Claws, Snow 16 - 24'
,
'Bread - Rolls, Rye'
,
'Wine - Pinot Grigio Collavini'
,
'Mikes Hard Lemonade'
,
'Chocolate - Semi Sweet'
,
'Wine - White, Chardonnay'
,
'Cheese - Mozzarella'
,
'Kaffir Lime Leaves'
,
'Cookies Almond Hazelnut'
,
'Aromat Spice / Seasoning'
,
'Pur Source'
,
'Pie Shells 10'
,
'Assorted Desserts'
,
'Tuna - Canned, Flaked, Light'
,
'Cranberries - Fresh'
,
'Ecolab - Hand Soap Form Antibac'
,
'Glove - Cutting'
,
'Sugar - Cubes'
,
'Mudslide'
,
'Wiberg Cure'
,
'Grenadine'
,
'Mince Meat - Filling'
,
'Pepper - Pablano'
,
'Chivas Regal - 12 Year Old'
,
'Spaghetti Squash'
,
'Quail - Jumbo'
,
'Towels - Paper / Kraft'
,
'Duck - Breast'
,
'Tamarind Paste'
,
'Pasta - Agnolotti - Butternut'
,
'Cream - 10%'
,
'Sun - Dried Tomatoes'
,
'Container - Hngd Cll Blk 7x7x3'
,
'Chicken Thigh - Bone Out'
,
'Bread - White, Unsliced'
,
'Wine - Red Oakridge Merlot'
,
'Bamboo Shoots - Sliced'
,
'Thyme - Lemon, Fresh'
,
'Lady Fingers'
,
'Muffin Batt - Carrot Spice'
,
'The Pop Shoppe - Grape'
,
'Lamb Shoulder Boneless Nz'
,
'Soup - Knorr, French Onion'
,
'Pasta - Rotini, Dry'
,
'Juice - Cranberry, 341 Ml'
,
'Fish - Scallops, Cold Smoked'
,
'Orange - Canned, Mandarin'
,
'Pepsi, 355 Ml'
,
'Hummus - Spread'
,
'Crackers - Trio'
,
'Barramundi'
,
'Mayonnaise - Individual Pkg'
,
'Tequila - Sauza Silver'
,
'Sauce - Soya, Light'
,
'Wine - Fontanafredda Barolo'
,
'Soup Campbells - Italian Wedding'
,
'Fish - Halibut, Cold Smoked'
,
'Pears - Bosc'
,
'Bacon Strip Precooked'
,
'Carroway Seed'
,
'Pea - Snow'
]
# OUTPUT
#print blank line
print
(
'\n'
)
#prints out each product in the array
for
i
in
range
(
0
,
len
(
productList
)
,
1
)
:
print
(
productList
[
i
]
)
# end loop
print
(
'\n'
)
original
# Tony's Grossery
# array of strings used to store list of products
productList
=
[
'Juice - Happy Planet'
,
'Edible Flower - Mixed'
,
'Turkey - Mince'
,
'Spinach - Packaged'
,
'Muffin - Banana Nut Individual'
,
'Wine - Jafflin Bourgongone'
,
'Mustard - Individual Pkg'
,
'Beer - Sleemans Cream Ale'
,
'Potatoes - Mini Red'
,
'Venison - Racks Frenched'
,
'Longos - Burritos'
,
'Milk - Chocolate 500ml'
,
'Yucca'
,
'Chilli Paste, Sambal Oelek'
,
'Soup - Campbells Beef Stew'
,
'Mikes Hard Lemonade'
,
'Remy Red Berry Infusion'
,
'Galliano'
,
'Long Island Ice Tea'
,
'Olives - Nicoise'
,
'White Fish - Filets'
,
'Vinegar - Raspberry'
,
'Quinoa'
,
'Coffee Decaf Colombian'
,
'Wine - Pinot Noir Mondavi Coastal'
,
'Scampi Tail'
,
'Soup Campbells - Tomato Bisque'
,
'Vinegar - White Wine'
,
'Coffee Cup 12oz 5342cd'
,
'Wine - Shiraz Wolf Blass Premium'
,
'Corn - Mini'
,
'Orange Roughy 6/8 Oz'
,
'Water - San Pellegrino'
,
'Banana - Leaves'
,
'Creme De Banane - Marie'
,
'Juice - Clamato, 341 Ml'
,
'Chicken - Wings, Tip Off'
,
'Honey - Comb'
,
'Grapefruit - White'
,
'Food Colouring - Red'
,
'Wine - White, Riesling, Henry Of'
,
'Yogurt - Raspberry, 175 Gr'
,
'Juice - Lime'
,
'Tomatoes - Grape'
,
'Cheese - Gorgonzola'
,
'Wanton Wrap'
,
'Burger Veggie'
,
'Juice - Orange 1.89l'
,
'Food Colouring - Orange'
,
'Bag - Bread, White, Plain'
,
'Sea Urchin'
,
'Butter - Unsalted'
,
'Coffee - Almond Amaretto'
,
'Cheese - Brie'
,
'Bread - Multigrain Oval'
,
'Sprouts - Bean'
,
'Wine - Alsace Riesling Reserve'
,
'Clam Nectar'
,
'Wine - Merlot Vina Carmen'
,
'Pecan Raisin - Tarts'
,
'Ecolab - Balanced Fusion'
,
'Otomegusa Dashi Konbu'
,
'Crab - Soft Shell'
,
'Mushroom - Chanterelle, Dry'
,
'Energy Drink'
,
'Coffee Guatemala Dark'
,
'Beef Wellington'
,
'Trueblue - Blueberry Cranberry'
,
'Hog / Sausage Casing - Pork'
,
'Tomatoes'
,
'Wine - White, Pinot Grigio'
,
'French Pastries'
,
'Pasta - Cheese / Spinach Bauletti'
,
'Chicken Breast Halal'
,
'Mousse - Mango'
,
'Bar Bran Honey Nut'
,
'Bread - Pullman, Sliced'
,
'Cheese - Le Cheve Noir'
,
'Onion Powder'
,
'Rice - Aborio'
,
'Figs'
,
'Olive - Spread Tapenade'
,
'Dikon'
,
'Nantucket Orange Juice'
,
'Juice - Orange'
,
'Duck - Whole'
,
'Oil - Truffle, White'
,
'Wine - Magnotta - Cab Franc'
,
'Table Cloth 144x90 White'
,
'Crab - Claws, Snow 16 - 24'
,
'Bread - Rolls, Rye'
,
'Wine - Pinot Grigio Collavini'
,
'Mikes Hard Lemonade'
,
'Chocolate - Semi Sweet'
,
'Wine - White, Chardonnay'
,
'Cheese - Mozzarella'
,
'Kaffir Lime Leaves'
,
'Cookies Almond Hazelnut'
,
'Aromat Spice / Seasoning'
,
'Pur Source'
,
'Pie Shells 10'
,
'Assorted Desserts'
,
'Tuna - Canned, Flaked, Light'
,
'Cranberries - Fresh'
,
'Ecolab - Hand Soap Form Antibac'
,
'Glove - Cutting'
,
'Sugar - Cubes'
,
'Mudslide'
,
'Wiberg Cure'
,
'Grenadine'
,
'Mince Meat - Filling'
,
'Pepper - Pablano'
,
'Chivas Regal - 12 Year Old'
,
'Spaghetti Squash'
,
'Quail - Jumbo'
,
'Towels - Paper / Kraft'
,
'Duck - Breast'
,
'Tamarind Paste'
,
'Pasta - Agnolotti - Butternut'
,
'Cream - 10%'
,
'Sun - Dried Tomatoes'
,
'Container - Hngd Cll Blk 7x7x3'
,
'Chicken Thigh - Bone Out'
,
'Bread - White, Unsliced'
,
'Wine - Red Oakridge Merlot'
,
'Bamboo Shoots - Sliced'
,
'Thyme - Lemon, Fresh'
,
'Lady Fingers'
,
'Muffin Batt - Carrot Spice'
,
'The Pop Shoppe - Grape'
,
'Lamb Shoulder Boneless Nz'
,
'Soup - Knorr, French Onion'
,
'Pasta - Rotini, Dry'
,
'Juice - Cranberry, 341 Ml'
,
'Fish - Scallops, Cold Smoked'
,
'Orange - Canned, Mandarin'
,
'Pepsi, 355 Ml'
,
'Hummus - Spread'
,
'Crackers - Trio'
,
'Barramundi'
,
'Mayonnaise - Individual Pkg'
,
'Tequila - Sauza Silver'
,
'Sauce - Soya, Light'
,
'Wine - Fontanafredda Barolo'
,
'Soup Campbells - Italian Wedding'
,
'Fish - Halibut, Cold Smoked'
,
'Pears - Bosc'
,
'Bacon Strip Precooked'
,
'Carroway Seed'
,
'Pea - Snow'
]
# OUTPUT
#print blank line
print
(
'\n'
)
#prints out each product in the array
print
(
productList
[
0
]
)
print
(
productList
[
1
]
)
print
(
productList
[
2
]
)
print
(
productList
[
3
]
)
print
(
productList
[
4
]
)
print
(
productList
[
5
]
)
print
(
productList
[
6
]
)
print
(
productList
[
7
]
)
print
(
productList
[
8
]
)
print
(
productList
[
9
]
)
print
(
productList
[
10
]
)
print
(
productList
[
11
]
)
print
(
productList
[
12
]
)
print
(
productList
[
13
]
)
print
(
productList
[
14
]
)
print
(
productList
[
15
]
)
print
(
productList
[
16
]
)
print
(
productList
[
17
]
)
print
(
productList
[
18
]
)
print
(
productList
[
19
]
)
print
(
productList
[
20
]
)
print
(
productList
[
21
]
)
print
(
productList
[
22
]
)
print
(
productList
[
23
]
)
print
(
productList
[
24
]
)
print
(
productList
[
25
]
)
print
(
productList
[
26
]
)
print
(
productList
[
27
]
)
print
(
productList
[
28
]
)
print
(
productList
[
29
]
)
print
(
productList
[
30
]
)
print
(
productList
[
31
]
)
print
(
productList
[
32
]
)
print
(
productList
[
33
]
)
print
(
productList
[
34
]
)
print
(
productList
[
35
]
)
print
(
productList
[
36
]
)
print
(
productList
[
37
]
)
print
(
productList
[
38
]
)
print
(
productList
[
39
]
)
print
(
productList
[
40
]
)
print
(
productList
[
41
]
)
print
(
productList
[
42
]
)
print
(
productList
[
43
]
)
print
(
productList
[
44
]
)
print
(
productList
[
45
]
)
print
(
productList
[
46
]
)
print
(
productList
[
47
]
)
print
(
productList
[
48
]
)
print
(
productList
[
49
]
)
print
(
productList
[
50
]
)
print
(
productList
[
51
]
)
print
(
productList
[
52
]
)
print
(
productList
[
53
]
)
print
(
productList
[
54
]
)
print
(
productList
[
55
]
)
print
(
productList
[
56
]
)
print
(
productList
[
57
]
)
print
(
productList
[
58
]
)
print
(
productList
[
59
]
)
print
(
productList
[
60
]
)
print
(
productList
[
61
]
)
print
(
productList
[
62
]
)
print
(
productList
[
63
]
)
print
(
productList
[
64
]
)
print
(
productList
[
65
]
)
print
(
productList
[
66
]
)
print
(
productList
[
67
]
)
print
(
productList
[
68
]
)
print
(
productList
[
69
]
)
print
(
productList
[
70
]
)
print
(
productList
[
71
]
)
print
(
productList
[
72
]
)
print
(
productList
[
73
]
)
print
(
productList
[
74
]
)
print
(
productList
[
75
]
)
print
(
productList
[
76
]
)
print
(
productList
[
77
]
)
print
(
productList
[
78
]
)
print
(
productList
[
79
]
)
print
(
productList
[
80
]
)
print
(
productList
[
81
]
)
print
(
productList
[
82
]
)
print
(
productList
[
83
]
)
print
(
productList
[
84
]
)
print
(
productList
[
85
]
)
print
(
productList
[
86
]
)
print
(
productList
[
87
]
)
print
(
productList
[
88
]
)
print
(
productList
[
89
]
)
print
(
productList
[
90
]
)
print
(
productList
[
91
]
)
print
(
productList
[
92
]
)
print
(
productList
[
93
]
)
print
(
productList
[
94
]
)
print
(
productList
[
95
]
)
print
(
productList
[
96
]
)
print
(
productList
[
97
]
)
print
(
productList
[
98
]
)
print
(
productList
[
99
]
)
print
(
productList
[
100
]
)
print
(
productList
[
101
]
)
print
(
productList
[
102
]
)
print
(
productList
[
103
]
)
print
(
productList
[
104
]
)
print
(
productList
[
105
]
)
print
(
productList
[
106
]
)
print
(
productList
[
107
]
)
print
(
productList
[
108
]
)
print
(
productList
[
109
]
)
print
(
productList
[
110
]
)
print
(
productList
[
111
]
)
print
(
productList
[
112
]
)
print
(
productList
[
113
]
)
print
(
productList
[
114
]
)
print
(
productList
[
115
]
)
print
(
productList
[
116
]
)
print
(
productList
[
117
]
)
print
(
productList
[
118
]
)
print
(
productList
[
119
]
)
print
(
productList
[
120
]
)
print
(
productList
[
121
]
)
print
(
productList
[
122
]
)
print
(
productList
[
123
]
)
print
(
productList
[
124
]
)
print
(
productList
[
125
]
)
print
(
productList
[
126
]
)
print
(
productList
[
127
]
)
print
(
productList
[
128
]
)
print
(
productList
[
129
]
)
print
(
productList
[
130
]
)
print
(
productList
[
131
]
)
print
(
productList
[
132
]
)
print
(
productList
[
133
]
)
print
(
productList
[
134
]
)
print
(
productList
[
135
]
)
print
(
productList
[
136
]
)
print
(
productList
[
137
]
)
print
(
productList
[
138
]
)
print
(
productList
[
139
]
)
print
(
productList
[
140
]
)
print
(
productList
[
141
]
)
print
(
productList
[
142
]
)
print
(
productList
[
143
]
)
print
(
productList
[
144
]
)
print
(
productList
[
145
]
)
print
(
productList
[
146
]
)
print
(
productList
[
147
]
)
Gallery
Share
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.