HomepageTeaching PageResearch PageResources Page

Homework: String Slices

Read sections 8.4 and 8.5 in the book and do the examples.

If you want to get really confusing, you can use two slices in a row. It's hard to parse it, though! Take a guess at what the following code is going to print, then try it out.

>>> x = "monkey"[1:4][1:]
>>> print(x)