"리스트 컴프리헨션"의 두 판 사이의 차이

(새 문서: ;list comprehension ==Python== <source lang='Python'> numbers = [1, 2, 3, 4, 5, 6] print( [x * 2 - 1 for x in numbers] ) # [1, 3, 5, 7, 9, 11] </source> ==같이 보기== *map)
 
2번째 줄: 2번째 줄:


==Python==
==Python==
[[category: Python]]
<source lang='Python'>
<source lang='Python'>
numbers = [1, 2, 3, 4, 5, 6]
numbers = [1, 2, 3, 4, 5, 6]

2014년 8월 22일 (금) 09:32 판

list comprehension

1 Python

numbers = [1, 2, 3, 4, 5, 6]
print( [x * 2 - 1 for x in numbers] )
# [1, 3, 5, 7, 9, 11]

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}