본문 바로가기

교육/[Codeit] 프로그래밍 기초 in Python

type 함수

반응형

꿀팁

어떤자료형인지 알고싶을때 type()을 쓴다.

print(type(3)) # int
print(type(3.0)) # float
print(type("3")) # str
print(type("True")) # str
print(type(True)) # bool
def hello():
print("Hello world")
print(type(hello)) # function 정의한 함수
print(type(print)) # builtin_function_or_method 내장되어있는 함수

 

 

728x90
반응형

'교육 > [Codeit] 프로그래밍 기초 in Python' 카테고리의 다른 글

함수 실행의 순서  (0) 2020.11.06
변수 제대로 이해하기  (0) 2020.11.06
불 대수, 불린형  (0) 2020.11.05
format 실습과제  (0) 2020.11.04
format을 이용한 문자열, format 다루기  (0) 2020.11.04