program/python

[python] type 함수

momoa210 2024. 1. 28. 00:50

 

print(type(2))  // <class 'int'>

print(type(2.2)) // <class 'float'>

print(type("test"))  //<class ' str'>

 

print(type("True"))  // <class 'str'>

print(type(True))  // <class 'bool'>

 

def Hello():

    print("test");

 

print(type( Hello ))  //     <class ' function'>

print(type( print )) // <class 'builtin_function_or_method'>   내장 함수 

'program > python' 카테고리의 다른 글

[python] Syntactic Sugar  (0) 2024.01.28
[python] window 설치  (0) 2024.01.28
[python] fomat 다루기  (0) 2024.01.28
[python] 문자열 포맷팅  (1) 2024.01.28
[python] 형변환  (0) 2024.01.28