문 ¶
- 러 료 (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
- 머 메는