Created
August 31, 2020 12:24
-
-
Save raeq/84dfdb1059c0eabdbb9d0cdfd4c2dec1 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'Start: {sl.start}') | |
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