반응형 python immutable1 [Python] Mutable, Immutable 결론 요약 Mutable Immutable 객체 생성 후, 상태 수정 가능 (메모리 주소 유지) 객체 생성 후, 상태 수정 불가 (메모리 주소 바뀜) 스레드로부터 안전하지 않다 스레드로부터 안전 list set dicitionary numbers ( int, float, rational, decimal, complex & boolean) str tuple frozen set Immutable 예제 코드 # Immutalbe 예제 print("="*30) print(" Immutable Int 예제") print("="*30) num1 = 1 num2 = 1 num3 = 1 print(f"num1 : {num1}, 주소 : {id(num1)}") print(f"num2 : {num2}, 주소 : {id(n.. 카테고리 없음 2023. 9. 15. 이전 1 다음 반응형