Python Strings Challenge II

When doing the string challenges, I came across a way to slice that is useful to the exercises.

sequence[start:stop:step]

string = "hello world"
print(string[0:5])  # prints "hello"
print(string[6:])  # prints "world"
print(string[::-1])  # prints "dlrow olleh"
print(string[::2])  # prints "hlowrd"

We were taught the first 2, but the last two are the most important.
The third is a way to reverse the string by using a step size of -1.
The fourth is a way to do every other string with a step size of 2.

The start/stop defaults to all strings, so leaving them empty means going through the entire string.

https://www.codecademy.com/journeys/computer-science/paths/cscj-22-intro-to-programming/tracks/cscj-22-basic-python-data-structures-and-objects/modules/cscj-22-python-code-challenges-ii/articles/advanced-python-code-challenges-strings