Python / str() / 자료형을 문자열로 변환하는 함수
str()은 데이터 타입을 문자열로 변환하는 함수이다.
>>> a = 1 >>> type( a ) <class 'int'> >>> print( a ) 1 >>> b = str( a ) >>> type( b ) <class 'str'> >>> print( b ) 1
>>> a = 1.23 >>> type( a ) <class 'float'> >>> print( a ) 1.23 >>> b = str( a ) >>> type( b ) <class 'str'> >>> print( b ) 1.23