- 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.
推薦閱讀
- C++ Primer習題集(第5版)
- iOS面試一戰到底
- Computer Vision for the Web
- PowerCLI Cookbook
- Magento 2 Theme Design(Second Edition)
- Getting Started with PowerShell
- Learning AWS Lumberyard Game Development
- 零基礎學Java程序設計
- C語言課程設計
- RabbitMQ Cookbook
- Scala Data Analysis Cookbook
- Learning YARN
- Building Microservices with Go
- Learning Redux
- Android項目實戰:博學谷