- Learn Python in 7 Days
- Mohit Bhaskar N. Das
- 122字
- 2021-07-09 20:40:25
Arithmetic expressions
Arithmetic expressions in any language comprise operands and operators. For reference, x and y are used as operands having values 10 and 20, respectively. The following table shows the precedence order:

In an arithmetic expression, generally, the rule of Bracket, Of, Division, Multiplication, Addition, and Subtraction (BODMAS) is followed, and operators have their own precedence order. Exponentiation enjoys a higher precedence order, while addition and subtraction have a lower precedence order.
The decreasing precedence order is as follows:
- Exponent
- Unary negation
- Multiplication, division, modulus
- Addition, subtraction
If operands are of the same data type, then the resulting value is also of that type. However, addition of two int data types can produce a long integer.
推薦閱讀
- Python for Secret Agents:Volume II
- Python零基礎快樂學習之旅(K12實戰訓練)
- Mastering Swift 2
- Full-Stack Vue.js 2 and Laravel 5
- 網店設計看這本就夠了
- iOS編程基礎:Swift、Xcode和Cocoa入門指南
- Mathematica Data Analysis
- Java:High-Performance Apps with Java 9
- RISC-V體系結構編程與實踐(第2版)
- Extreme C
- App Inventor 2 Essentials
- 交互設計師成長手冊:從零開始學交互
- ROS機器人編程實戰
- Visual C++程序設計全程指南
- Learn Linux Quickly