Appearance
数据类型
SQL 有 Null ,Python 有 None 。
Python 内置函数与数据类型相关的有:bool complex float int str type 。
# 逻辑值
bool(1)
# 复数
complex(1)
complex('1')
complex(1, 2)
# 浮点数
float(1)
# 整数
int(1.5)
# 文本
str(123)
# 类型
type(1)True
(1+0j)
(1+0j)
(1+2j)
1.0
1
'123'
<class 'int'>手动输入
# 逻辑值
True
False
# 复数
1 + 2j
# 浮点数
1.5
# 整数
1
# 文本
'123'
# 空文本
''
NoneTrue
False
(1+2j)
1.5
1
'123'
''