第一章 数据结构 -- 基本数据类型

第零章 学前准备

第一章 数据结构之基本数据类型

1.1 基本数据类型

1.1.1 数字类型

整型( int )、浮点型( float )和复数( complex

print(1e3)
print(12.3)
print(complex(12, 12))
1000.0
12.3
(12+12j)

1.1.2 布尔类型

print(bool(0), bool(1))
# 对于空集合都为False
print(bool({
    
    }), bool(set()), bool(()), bool(None), bool(''), bool([]))
False True
False False False False False False

猜你喜欢

转载自blog.csdn.net/qq_31654025/article/details/128499530
今日推荐