Created
August 31, 2020 12:24
-
-
Save raeq/7192310939a82111d58b6e059a093d05 to your computer and use it in GitHub Desktop.
Slice Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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