Python - 1. Built-in Atomic Data Types
2024-10-11 09:54:51
From:http://interactivepython.org/courselib/static/pythonds/Introduction/GettingStartedwithData.html
- 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 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 | and and | Both operands True for result to be True |
logical or | or or | One or the other operand is True for the result to be True |
logical not | not not | 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
最新文章
- 自己写的基于bootstrap风格的弹框插件
- log4j配置说明
- 烂泥:linux文件同步之rsync学习(一)
- 手把手教你如何把java代码,打包成jar文件以及转换为exe可执行文件
- crossplatform---Nodejs in Visual Studio Code 10.IISNode
- sql临时表和表变量
- HDU1002 -A + B Problem II(大数a+b)
- Re-installation failed due to different application signatures./package name has exist
- PreResultListener使用
- 100% width CSS 在 iPad / iPhone Safari 背景被截断 / 显示不全
- POJ 1379 Run Away 【基础模拟退火】
- 使用js对form表单base64加密
- Python自动化--语言基础8--接口请求及封装
- pyinstaller使用-python项目转换成exe可执行文件
- CEYE平台的使用
- 重写COMBOXEDIT
- Vue+iview实现添加删除类
- PHP 随笔记
- C#并行编程(1):理解并行
- Excel 2016 Power View选项卡不显示的问题
热门文章
- Chrome中安装Firebug插件
- 洛谷P3245 大数 [HNOI2016] 莫队
- 批量删除以及将String数组转换成Integer数组的奇淫技巧
- (1.13)mysql优化数据库对象
- 如何将finecms链接URL中的list和show去掉
- css自动换行如何设置?url太长会撑开页面
- NYOJ 会场安排问题
- django中常用到的前端样式
- Kubernetes总结
- 【Java】-NO.14.Java.4.Java.1.001-【Java JUnit 5 】-