반응형 ByteArray2 [Python] 바이트 문자열과 바이트 배열의 차이 이해하기 바이트 문자열의 불변 객체 특성으로 발생할 수 있는 상황을 이해합니다. 목차 개발 의도# 바이트 문자열 생성byte_str = b"hello"print("byte string:", byte_str)# 바이트 문자열 생성byte_str[0] = b"a"print("byte string:", byte_str)# 출력값: TypeError: 'bytes' object does not support item assignment- 위와 같이 바이트 문자열을 생성하고, 첫 글자를 수정합니다. - 최종 출력값은 b"aello"가 되어야 합니다. 문제 상황- 위 함수를 실행했을 때, 최종 출력값이 TypeError: 'bytes' object does not support item assignmen.. 2024. 11. 13. [파이썬, Python] int 정리 [ 파이썬 int 정리 ] help(int) : int 도움말 보기 help(int) ''' [출력값] class int(object) int(x=0) -> integer int(x, base=10) -> integer Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero. If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance rep.. 2022. 4. 5. 이전 1 다음 반응형