We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fbe4418 + 214d3c4 commit cd62ee0Copy full SHA for cd62ee0
1 file changed
episodes/12-for-loops.md
@@ -360,4 +360,16 @@ print(total)
360
> print('My favorite season is ', seasons[4])
361
> ~~~
362
> {: .python}
363
+>
364
+> > ## Solution
365
+> >
366
+> > It is an index error:
367
+> > ~~~
368
+> > IndexError: list index out of range
369
370
+> > {: .error}
371
372
+> > The problem is that `4` points to an item that doesn't exist in the list. Remember the first item of a list in Python is `0`.
373
+> > Replace `seasons[4]` with `seasons[0]`, `seasons[1]`, `seasons[2]` or `seasons[3]` to have the different items of the list printed.
374
+> {: .solution}
375
{: .challenge}
0 commit comments