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 | 29 | 30 | 31 |
Tags
- 핑거스타일
- ubuntu
- Linux
- error
- C#
- 프로그래머스
- OpenCV
- C
- windows forms
- label
- Numpy
- Docker
- VS Code
- 기타 연주
- mysql
- SSH
- C++
- pip
- 오류
- JSON
- paramiko
- pytorch
- YOLO
- 컨테이너
- nvidia-smi
- Selenium
- pandas
- 채보
- Visual Studio
- Python
Archives
- Today
- Total
목록comprehension (1)
기계는 거짓말하지 않는다

리스트의 선언, 할당 과정을 간단하게 한 줄로 처리할 수 있다. 리스트 내포의 간단한 사용 예시이다. # 순차 할당 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