- Python Data Structures and Algorithms
- Benjamin Baka
- 115字
- 2021-07-09 19:45:01
Comparison and Arithmetic operators
The standard arithmetic operators (+, -, *, /) work with all Python numeric types. The // operator gives an integer quotient, (for example, 3 // 2 returns 1), the exponent operator is x ** y, and the modulus operator, given by a % b, returns the remainder of the division a/b. The comparison operators (<, <=, >, >=, ==, and !=) work with numbers, strings, lists, and other collection objects and return True if the condition holds. For collection objects, these operators compare the number of elements and the equivalence operator == b returns True if each collection object is structurally equivalent, and the value of each element is identical.
推薦閱讀
- SPSS數(shù)據(jù)挖掘與案例分析應(yīng)用實(shí)踐
- CMDB分步構(gòu)建指南
- Java 9 Programming Blueprints
- 云原生Spring實(shí)戰(zhàn)
- VMware vSphere 6.7虛擬化架構(gòu)實(shí)戰(zhàn)指南
- PostgreSQL Replication(Second Edition)
- Reactive Android Programming
- JavaScript 程序設(shè)計(jì)案例教程
- FPGA Verilog開發(fā)實(shí)戰(zhàn)指南:基于Intel Cyclone IV(進(jìn)階篇)
- Lighttpd源碼分析
- 移動(dòng)互聯(lián)網(wǎng)軟件開發(fā)實(shí)驗(yàn)指導(dǎo)
- Cocos2d-x Game Development Blueprints
- Apache Camel Developer's Cookbook
- Go語言底層原理剖析
- OpenMP核心技術(shù)指南