JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Debug 7.2. Easy 123
Share
Explore
Gallery
Solution Debug 7.2. Easy 123
Solution Debug 7.2. Easy 123
Solution
The Task
Python Starter Code
Code Clips
Solution
Solution
solution
# print a heading
print
(
'\n\nCartoon Favourites\n\n'
)
# sets up array of strings
toons
=
[
'Baymax'
,
'Buzz'
,
'Lightning McQueen'
,
'Sulley'
,
'Nemo'
,
'Crush'
,
'Forky'
,
'Bo-Peep'
,
'Rex'
,
'Boo'
]
# repeats for the size of the array and prints each out element
for
i
in
range
(
0
,
len
(
toons
)
,
1
)
:
print
(
str
(
i
+
1
)
+
' : '
+
toons
[
i
]
)
print
(
'\n\n'
)
# display blank line (2)
original
# print a heading
print
(
'\n\nCartoon Favourites\n\n'
)
# sets up array of strings
toons
=
[
'Baymax'
,
'Buzz'
,
'Lightning McQueen'
,
'Sulley'
,
'Nemo'
,
'Crush'
,
'Forky'
,
'Bo-Peep'
,
'Rex'
,
'Boo'
]
# repeats for the size of the array and prints each out element
for
i
in
range
(
1
,
len
(
toons
)
,
1
)
:
print
(
str
(
i
+
1
)
+
' : '
+
toons
[
1
]
)
print
(
'\n\n'
)
# display blank line (2)
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.