본문 바로가기

Study/Python

문자열 정수형으로 바꾸기, 데이터 타입(자료형) 확인하기

A = "7"
print(type(A))

# [결과]
# <class 'str'>
A = "7"
print(type(int(A)))

# [결과]
# <class 'int'>

type() : 데이터 타입(자료형) 확인