DrZhang We've seen the basic data types in Python —— strings, integers, floats, and booleans. If we are unsure of a value type, we can check it. Here, type() checks that box is a bool, which is short for booleawn. >>> box = True >>> type(box) <class 'bool'>
DrZhang 我们已经看到了 Python 中的基本数据类型——字符串、整数、浮点数和布尔值。如果我们不确定某个值的类型,可以进行检查。在这里,type() 检查 box 是否是 bool,bool 是布尔值(boolean)的缩写。