官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 宜黄县| 石林| 防城港市| 都安| 汾阳市| 牡丹江市| 南汇区| 南陵县| 乌拉特中旗| 建瓯市| 沈阳市| 东乡| 汉中市| 宜城市| 建德市| 秭归县| 兴安盟| 广宁县| 崇义县| 土默特左旗| 西安市| 温州市| 杨浦区| 花垣县| 吉隆县| 南漳县| 岑巩县| 大庆市| 盈江县| 淮北市| 新和县| 黄石市| 临高县| 甘孜县| 龙江县| 宁安市| 合肥市| 开封县| 信丰县| 北安市| 客服|