- Python Data Structures and Algorithms
- Benjamin Baka
- 82字
- 2021-07-09 19:45:01
Operations and expressions
There are a number of operations that are common to all data types. For example, all data types, and generally all objects, can be tested for a truth value in some way. The following are values that Python considers False:
- The None type
- False
- An integer, float, or complex zero
- An empty sequence or mapping
- An instance of a user-defined class that defines a __len__() or __bool__() method that returns zero or False
All other values are considered True.
推薦閱讀
- Beginning C++ Game Programming
- 垃圾回收的算法與實現
- 自己動手寫Java虛擬機
- Twilio Best Practices
- 碼上行動:用ChatGPT學會Python編程
- PHP+MySQL+Dreamweaver動態網站開發從入門到精通(第3版)
- Python深度學習:模型、方法與實現
- Python機器學習:預測分析核心算法
- INSTANT Yii 1.1 Application Development Starter
- Android Studio Cookbook
- Android系統下Java編程詳解
- Python Deep Learning
- Go語言入門經典
- Mastering Unreal Engine 4.X
- Google Maps JavaScript API Cookbook