python constants_Python 内置常量

Built-in Constants

False:The false value of the bool type. Assignments to False are illegal and raise a SyntaxError.

True:The true value of the bool type. Assignments to True are illegal and raise a SyntaxError.

None:The sole value of the type NoneType. None is frequently used to represent the absence of a value, as when default arguments are not passed to a function. Assignments to None are illegal and raise a SyntaxError.

NotImplemented:Special value which should be returned by the binary special methods to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods for the same purpose. Its truth value is true.

Ellipsis:The same as .... Special value used mostly in conjunction with extended slicing syntax for user-defined container data types.

Constants added by the site module

The site module (which is imported automatically during startup, except if the -S command-line option is given) adds several constants to the built-in namespace. They are useful for the interactive interpreter shell and should not be used in programs.

quit (code=None)

exit (code=Node):Objects that when printed, print a message like “Use quit() or Ctrl-D (i.e. EOF) to exit”, and when called, raise SystemExit with the specified exit code.

copyright

credits:Objects that when printed or called, print the text of copyright or credits, respectively.

license:Object that when printed, prints the message “Type license() to see the full license text”, and when called, displays the full license text in a pager-like fashion (one screen at a time).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值