티스토리 뷰
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
좀더 효율적으로 반복하기
>>> l = ['A','B','C']
>>> for i in l:
print(i)
A
B
C
>>> print('\n'.join(str(i) for i in l))
A
B
C
※위의 2가지 방법은 l이라는 list를 순회하여 출력함.
결과값은 모두 같지만 내장메소드인 join을 이용하여 두번째 방법으로 출력하는방법이 속도면에서 가장 빠름.
'Python' 카테고리의 다른 글
Python,module os [운영체제] (0) | 2016.04.21 |
---|---|
Python, Class (0) | 2016.04.21 |
Python, map() (0) | 2016.04.21 |
Python, zip() (0) | 2016.04.21 |
Python, filter() (0) | 2016.04.21 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- activeforeground
- Excel
- IdClass
- apache
- vba
- highlightbackground
- disabledforeground
- tkinter command & bind [명령어묶기와 사건묶기] Python
- command
- Linux
- activebackground
- 상수
- 폼
- FetchType
- fetch join
- JPA
- highlightthickness
- tkinter
- onetomany
- Private
- indicatoron
- 리눅스
- ManyToOne
- Composite Key
- 파이썬
- Python
- Java
- borderwidth
- checkbutton
- Module
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함