44-1>>> >>> >>> >>> >>> >>> 4-2>>> >>> (>>> s = >>> s >>> (s) 4-3>>> () >>> (r) 4-4 using triple-quotes: ( --4-5+ operator, repeated with *>>> >>> 3 * + 4-6>>> 4-7 particularly useful when you want to >>> text = (>>>4-8 with variables >>> prefix = >>> prefix File , line 1^>>> ( * 3) , line 1 * 3) ^4-9 a variable a literal, use +>>> prefix + 4-10>>> word = >>> word[0] >>> word[5] 4-11>>> word[-1] >>> word[-2] >>> word[-6-0 和 0 是一样的,所以负数索引从 -14-12>>> word[0:2] >>> word[2:5] 4-13+>>> word[:2] + word[2>>> word[:4] + word[44-14>>> word[:2] >>> word[4:] >>> word[-2:] +---+---+---+---+---+---+ | P | y | t | h | o | n | +---+---+---+---+---+---+1 2 3 4 5 6-6 -5 -4 -3 -2 -11:34-15>>> word[42] , line 1, <module>4-16>>> word[4:42>>> word[424-17>>> word[0] = , line 1, <module> object does >>> word[2:] = , line 1, <module> object does 4-18>>> + word[1>>��������,��������;> word[:2] + 4-19>>> s = >>>34