Skip to content

Instantly share code, notes, and snippets.

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