첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
------------------------------------------------------------------------------------------------------------------------------------------------------
728x90
728x170

■ list 클래스에서 + 연산자를 사용해 정수 리스트에 문자열 리스트를 더하는 방법을 보여준다.

 

▶ 예제 코드 (PY)

list1 = [1, 2, 3, 4]

print(list1)

list2 = ['I', 'tripped', 'over', 'and', 'hit', 'the', 'floor']

print(list2)

list3 = list1 + list2

print(list3)

"""
[1, 2, 3, 4]
['I', 'tripped', 'over', 'and', 'hit', 'the', 'floor']
[1, 2, 3, 4, 'I', 'tripped', 'over', 'and', 'hit', 'the', 'floor']
"""
728x90
그리드형(광고전용)
Posted by icodebroker
,