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 |
Tags
- 토마토#백준알고리즘#Python
- N으로 표현#DP#Programmers#Python
- PassingCars#Codility#Python
- 텀 프로젝트#백준알고리즘#Python
- 미로 탐색#백준알고리즘#Python
- 랜선자르기#이분탐색#BOJ#Python
- 병든 나이트#BOJ#탐욕법#Python
- 리모컨#완전탐색#BOJ#Python
- Brackets#Stacks and Queues#Codility#Python
- 종이자르기#분할정복#BOJ#Python
- 날짜 계산#BOJ#완전탐색#Python
- 백준 알고리즘#BackTracking
- 터틀비치#리콘#xbox#controller
- 나무자르기#BOJ#이분탐색#Python
- Swift#Tuples#Range
- 쿼드트리#BOJ#분할정복#Python
- 암호코드#dp#BOJ#Python
- 파이썬알고리즘인터뷰#4장
- Triangle#Sorting#Codility#Python
- 섬의개수#백준알고리즘#Python
- django
- 순열사이클#BOJ#Python
- filter#isalnum#lower
- API#lazy#
- Distinct#Codility#Python
- 공유기 설치#BOJ#이분탐색#Python
- NumberofDiscIntersections#Codility#Sort#Python
- 반복수열#백준알고리즘#Python
- 배열합치기#분할정복#BOJ#Python
- django#slicing
Archives
- Today
- Total
B_log
2차원 리스트 본문
👨💻 관련 학습
- zip(*iterable) 함수 : 동일한 개수로 이루어진 자료형들을 묶어주는 함수
ex) a = [1,2,3], b =[4,5,6] ==> list(zip(a, b)) = [(1,4),(2,5),(3,6)] 묶은 결과는 반드시 dict이나 list로 변환해주어 사용해 야한다.
개수가 동일하지 않은 자료끼리 묶으면 개수가 작은 쪽이 들어갈 때 까지만 묶어준다.
🚦 리스트 초기화 방법

- n, m 행렬을 입력받을 경우 초기화 방법
mylist = [ list(map(int, input().split())) for _ in range(n) ]
- 값이 1인 요소의 인덱스 찾기
newlist = [ (i,j) for i in range(n) for j in range(m) if mylist[i][j] == 1 ]
💾 예시
-
- 출처 : https://swexpertacademy.com/
'알고리즘 학습' 카테고리의 다른 글
| 검색(Searching) (0) | 2020.05.11 |
|---|---|
| 정렬(Sort) (0) | 2020.05.11 |
| 완전검색(Exhaustive Search), Brute Force (0) | 2020.05.11 |
| 리스트(List) (0) | 2020.05.11 |