Python - 1. Built-in Atomic Data Types

From:http://interactivepython.org/courselib/static/pythonds/Introduction/GettingStartedwithData.html

  1. numeric classes 

Python has two main built-in numeric classes that implement the integer and floating point data types.Note that when two integers are divided, the result is a floating point.

  2. The boolean data type

>>> True
True
>>> False
False >>> False or True True >>> not (False or True) False >>> True and True True

In addition, relational operators and logical operators can be combined together to form complex logical questions.

Operation NameOperatorExplanation
less than< Less than operator
greater than> Greater than operator
less than or equal<= <= Less than or equal to operator
greater than or equal>= >= Greater than or equal to operator
equal== == Equality operator
not equal!!= Not equal operator
logical andanand Both operands True for result to be True
logical oroor One or the other operand is True for the result to be True
logical notnonot Negates the truth value, False becomes True, True becomes False

  3. Identifiers

>>> theSum = 0
>>> theSum 0 >>> theSum = theSum + 1 >>> theSum 1 >>> theSum = True >>> theSum True
../_images/assignment1.png
../_images/assignment2.png
 
 

转载于:https://www.cnblogs.com/keepSmile/p/7878117.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值