¶
- (sequence) .
- (Sequence)
- 객
- 객간 .
- 각 객 ( )
- 객
- 굳 C 과 . ( 기 기)
~cpp >>> s = 'abcdef' # >>> L = [100,200,300] # >>> t = ('tuple', 'object', 1, 2) #
(Sequence) () ¶
- (Indexing) = k
- (Slicing) = [[ s : t ]
- 결기(Concatenation) = +
- (Repeat) = *
- (Membership Test) = in
- 길 = len
-- --
~cpp >>> s = 'abcdef' >>> l = [100, 200, 300]
¶
- '( ) " ( ) .
-
- 개 경 그 .
~cpp >>> s = 'Handsome guy Chang-Jae' >>> L = "Hwang = Babo" >>> p = ''' 금 고 ??? 겼. . 고 . . 게 걸까, 겠.'''
- 기
기 | |
\n \012 | 꾸기 |
\t | |
\Enter | 계() |
\ | \ |
- (Sequence) .
- 그 값 경 , 경 (immutable) .
(1.6 ) ¶
- 거고 .
¶
~cpp >>> s = 'i like programing' >>> s.'''upper'''() # 'I LIKE PROGRAMING' >>> s.'''upper'''().'''lower'''() # 'i like programing' >>> s.'''capitalize'''() 'I like programing' #
과 ¶
~cpp >>> s = 'i like programing, i like swimming' >>> s.count('like') 2 >>> s.find('like') 2 >>> s.find('my') -1 >>> s.rfind('like') 22 >>> s.index('like') 2 >>> s.index('my') Traceback (most recent call last): File "<pyshell#40>", line 1, in ? s.index('my') valueError : substring not found in string.index
결 ¶
~cpp >>> u = ' spam and ham ' >>> u .'''split'''() # 공 기 ['spam','and','ham'] <--- . >>> u.'''split'''('and') # 'and' 기 . 'and' . ['spam', 'ham'] >>> t = u.'''split'''() >>> ':'.'''join(t)''' # ':' 결. 기 !! 'spam:and:ham' >>> print '\n'.join(t) # 꾸기 결. spam and ham
- 그