목록ZIP (1)
IT 세계의 후아
[python]zip 활용 - dict, 리스트, 문자열, 반복문
※ for N in zip(iterable1, iterable2, ...)내장함수로, iterable 객체 여러개를 받아 tuple로 묶어주는 역할for z in zip("abc", [1,2,3]): print(z)("a", 1)("b", 2)("c", 3) ※ for k,v in dict(zip(리스트1, 리스트2)key: 리스트1, value: 리스트2# 프로그래머스 수 조작하기1# control: 문자열 'wdsaaw...'def solution(n, control): w = control.count('w') s = control.count('s') d = control.count('d') a = control.count('a') r..
Coding/Python
2024. 4. 17. 23:48