Skip to content

Instantly share code, notes, and snippets.

@raeq
Created August 31, 2020 12:19
Show Gist options
  • Save raeq/5f268b5896726aad708c7783992c1e70 to your computer and use it in GitHub Desktop.
Save raeq/5f268b5896726aad708c7783992c1e70 to your computer and use it in GitHub Desktop.
Using a slice object.
hello: str = 'Hello World!'
sl: slice = slice(-2, 5, -1)
assert hello[sl] == 'dlroW'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment