Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- C#
- error
- SSH
- ubuntu
- pytorch
- 프로그래머스
- YOLO
- Selenium
- LIST
- 오류
- Numpy
- VS Code
- 핑거스타일
- C++
- windows forms
- Docker
- mysql
- Linux
- Python
- C
- 컨테이너
- label
- Visual Studio
- paramiko
- OpenCV
- 채보
- 기타 연주
- pandas
- JSON
- pip
Archives
- Today
- Total
목록comprehension (1)
기계는 거짓말하지 않는다
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/rTmsu/btrMrRXGSd0/zRjCJmjF8vk52MnfxhktJ0/img.png)
리스트의 선언, 할당 과정을 간단하게 한 줄로 처리할 수 있다. 리스트 내포의 간단한 사용 예시이다. # 순차 할당 temp_list = [i for i in range(10)] print(temp_list, "\n", "-" * 40) # 2중 반복 temp_list = [j for i in range(3) for j in range(5)] print(temp_list, "\n", "-" * 40) # 조건문 temp_list = [i for i in range(10) if i > 5 or i < 2] print(temp_list, "\n", "-" * 40) # 대입 값 조건문 temp_list = [i if i < 5 else -1 for i in range(10)] print(temp_list, ..
Python
2022. 9. 19. 17:41