博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python - 1. Built-in Atomic Data Types
阅读量:4631 次
发布时间:2019-06-09

本文共 1217 字,大约阅读时间需要 4 分钟。

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

>>> TrueTrue>>> FalseFalse >>> 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 Name Operator Explanation
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 and anand Both operands True for result to be True
logical or oor One or the other operand is True for the result to be True
logical not nonot 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

你可能感兴趣的文章
grep的小技巧
查看>>
maven install 打包 报错 Cannot run program "gpg.exe": CreateProcess error
查看>>
abstract类中method
查看>>
mysql中 where in 用法
查看>>
Farseer.net轻量级开源框架 中级篇:探究ORM(Mapping)
查看>>
对象,对象引用变量理解
查看>>
14Oracle Database 高级事务,游标
查看>>
Qt无法调试Qvector
查看>>
小白_Unity引擎_MonoBehaver
查看>>
图论算法——SPFA算法
查看>>
linux实现自动检测进程是否存活的脚本
查看>>
HttpWatch的时间分析
查看>>
CSS3 Transform
查看>>
loadrunner生成随机数
查看>>
LoadRunner测试场景中添加负载生成器
查看>>
20145315 《信息安全系统设计基础》第9周学习总结
查看>>
windows系统下安装memcache
查看>>
20170502 匹配单个字符串
查看>>
day7
查看>>
实战 iTextSharp
查看>>