Home > other >  The python string
The python string

Time:03-15

1. A string of positive sequence and negative sequence


STR='0123456789'
Print STR [3-0] # intercept first to the third characters
Print STR [:] # intercept all the character string
Print STR [6:] # intercept the seventh character to end
Print STR [: - 3] # intercept from the beginning to the third from bottom character before
Print STR [2] # intercept the third characters
Print STR [1] # intercept from the first character
Print STR [: : - 1] # to create an opposite to the sequence of the original string string
Print STR [] - 3: - 1 # intercept third from bottom and the bottom of characters before the first
Print STR/- 3: # intercept third from bottom to the end
  • Related