Type int
x = 5
print(type(x))
Type Float
x = 5.5
print(type(x))
Type String
x = ‘Chung! dep trai’
print(type(x))
Type Boelean
x = True
print(type(x))
Type Comple Số phức
x = complex(3,2)
print(type(x))
print (x.real,x.imag)
Type other
import sysconfig
print(sysconfig)
'''
Created on 2019/08/26
@author: ChungIT.Home.Blog
'''
# Type int
x = 5
print(type(x))
#Type Float
x = 5.5
print(type(x))
#Type String
x = 'Chung! dep trai'
print(type(x))
#Type Boelean
x = True
print(type(x))
#Ty Comple So phuc
x = complex(3,2)
print(type(x))
print (x.real,x.imag)
import sysconfig
print(sysconfig)
Kết quả:
<type 'int'>
<type 'float'>
<type 'str'>
<type 'bool'>
<type 'complex'>
(3.0, 2.0)
<module 'sysconfig' from 'C:\Users\600205\Downloads\pleiades\python\2\lib\sysconfig.pyc'>
