@ Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic (No. 948 / 12833)
, offset 12 to 14 (Python does not include the last offset):
>>> letters[12:15]
'xyz'
I tried it with ideone.
http://ideone.com/0q0x1y
alphabet = 'abcdefghijklmnopqrstuvwxyz'
print(len(alphabet))
print(alphabet[0:25])
print(alphabet[:25])
print(alphabet[::-1])
result
Success time: 0.01 memory: 9992 signal:0
26
abcdefghijklmnopqrstuvwxy
abcdefghijklmnopqrstuvwxy
zyxwvutsrqponmlkjihgfedcba
I think it's easy to make mistakes when returning to Python from another language.
Recommended Posts