Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
Python type() Check Python data type 본문
Check Python data type
Python에서는 데이터타입을 확인 하기 위해서는 type() 을 사용하여 확인 합니다.
print(type(123)) print(type(12.3)) print(type('123'))
# <class 'int'> # <class 'float'> # <class 'str'>
print(type([])) print(type([1, 2, 3, 4, 5])) print(type({})) print(type(()))
# <class 'list'> # <class 'list'> # <class 'dict'> # <class 'tuple'>
print(type(None))
# <class 'NoneType'>
print(type('한글')) print(type(u'한글'))
# <class 'str'> # <class 'str'>
'랭귀지 > python' 카테고리의 다른 글
Python Named colors in matplotlib (0) | 2018.10.03 |
---|---|
Python 슬라이싱으로 문자열 나누기 (0) | 2018.10.02 |
Python split() join() (0) | 2018.09.29 |
python for에서 인덱스와 요소의 값을 동시에 출력하기 (0) | 2018.09.28 |
python while (0) | 2018.09.27 |
Comments