tuple, dic 의 정리 및 활용
a = [i for i in range(10) if i % 2 == 0 ] print(a) [0, 2, 4, 6, 8] 튜플 -하나의 데이터가 저장되는 경우, 쉼표를 입력해만 합니다. -tuple은 원소(element)의 값을 변경할 수 없습니다. -만약 값을 바꾸고 싶다면 똑같은 변수에 업데이트 후 이전 data를 날려야 한다 -원칙적으로 튜플은 괄호와 함께 데이터를 정의해야 하지만, 사용자 편의를 위해 괄호 없이도 동작합니다. -튜플을 리스트로 변환할수 있다 반대로 리스트를 튜플도 가능하다 변수 = list(튜플이 있는 변수) tuple -아래와 같이 가능 temp = ('apple', 'banana', 'cake') a, b, c = temp print(a, b, c) #apple banana ca..
2021.07.30