Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Advanced slicing
- """
- # 応用的な使い方1
- # third parameterはstep size.この例ではstep size = 2
- s = 'Python is Fun!'
- s[1:12:2]
- # ---> 'yhni u'
- # 応用的な使い方2
- # we're asking for the full string s (from index 0 through 13), with a step size of 2
- s[::2]
- # ---> 'Pto sFn'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement