在Python中,你可以使用内置函数 `bool()` 来查看一个对象的布尔值。`bool()` 函数会返回对象的布尔表示,其中:
任何非零数值、非空序列(如列表、元组、字典)或非空集合的布尔值为 `True`。
`False`、`0`、空字符串、空列表、空元组、空字典和空集合的布尔值为 `False`。

下面是一些示例代码,展示了如何使用 `bool()` 函数来查看不同对象的布尔值:
print('-----测试对象的布尔值-----')print(bool(False)) Falseprint(bool(0)) Falseprint(bool(0.0)) Falseprint(bool('')) Falseprint(bool([])) Falseprint(bool(())) Falseprint(bool({})) Falseprint(bool(set())) False
