윤인선님 강의[21] for문 문제
21. 리스트와 for 반복문 numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9] output = [[],[],[]] for number in numbers: output[(numbers - 1) % 3].append(number) print(output) #[ [1, 4, 7], [2, 5, 8], [3, 6, 9] ] ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ 풀이 numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9] output = [[], [], []] output[1].append(1) output[2].append(2) output[0].append(3) output[1].append(4) output[2].append(5) output[0].appe..
2021.08.01