python 布尔型的定义_布尔的定义

python 布尔型的定义

Definition:

定义:

Bool is a fundamental type in C, C++ and C# languages.

Bool是C,C ++和C#语言的基本类型。

Variables of this type can only take two values- 1 and 0. In C++ these correspond to true and false and can be used interchangably. In C# bool variables can only use true and false, they are not interchangeable with 1 and 0.

这种类型的变量只能采用两个值-1和0。在C ++中,它们对应于true和false,可以互换使用。 在C#中,布尔变量只能使用true和false,它们不能与1和0互换。

Boolean variables can be packed together to save memory space. An understanding of binary can be a useful skill.

布尔变量可以打包在一起以节省内存空间。 理解二进制可能是有用的技能。

Note Because of the way false and 0 are usually treated the same (except in C#), any non zero value is the same as true, not just 1.

注意由于通常将false和0视为相同(在C#中除外),因此任何非零值都与true相同,而不仅仅是1。

  (   )

Also Known As: Boolean

也称为:布尔值

Examples: Using a bool and checking for true/false improves readability of your program

示例:使用布尔值并检查对/错是否可以提高程序的可读性

翻译自: https://www.thoughtco.com/definition-of-bool-958287

python 布尔型的定义

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值