python - join과 split
Programming/Python2015. 7. 27. 23:58
join
리스트 or 튜플을 인수로하여 요소사이에 문자열을 삽입하여 연결해준다.
'$'.join(['100', '200', '300']) # 100$200$300
split
문자열을 분리해서 리스트로 반환
str='owl,dog,cat'
sp_str=str.split(',')
print(sp_str)
'Programming > Python' 카테고리의 다른 글
python 가변 매개변수 (0) | 2017.02.13 |
---|---|
python - raise (0) | 2015.08.12 |
python - set (0) | 2015.07.27 |
python에서의 언더바(__) (0) | 2015.07.20 |
python self, __init__ (0) | 2015.07.16 |