Skip to content

Instantly share code, notes, and snippets.

@raeq
Created August 31, 2020 12:22
Show Gist options
  • Save raeq/f19c7f70f9ee3912832a7be0c4384ee5 to your computer and use it in GitHub Desktop.
Save raeq/f19c7f70f9ee3912832a7be0c4384ee5 to your computer and use it in GitHub Desktop.
Slice objects
hello: str = 'Hello World!'
sl: slice = slice(-2, 5, -1)
print(sl.start)
print(sl.stop)
print(sl.step)
print(hello[sl])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment