■ list 클래스에서 다중 리스트 내장을 사용하는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
list1 = ["a", "b", "c"] list2 = ["1", "2"] list3 = [x + y for x in list1 for y in list2] print(list3) """ ['a1', 'a2', 'b1', 'b2', 'c1', 'c2'] """ |
■ list 클래스에서 다중 리스트 내장을 사용하는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
list1 = ["a", "b", "c"] list2 = ["1", "2"] list3 = [x + y for x in list1 for y in list2] print(list3) """ ['a1', 'a2', 'b1', 'b2', 'c1', 'c2'] """ |