Skip to content

Commit

Permalink
黄哥所写python文章
Browse files Browse the repository at this point in the history
  • Loading branch information
likepython committed May 6, 2016
1 parent 7a403d7 commit a1e1335
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python/learn_python_follow_brother_huang_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@

## 运算符是一种特殊的符号(如,+,-,*等),用来对一个值或多个数值的特殊运算。

算术运算符
+ 进行加法运算
>>> 3 + 5
8

![](operator.png)
算术运算符

+ 进行加法运算
>>> 3 + 5
- 减法 35 - 20
* 乘法 3 * 3
/ 除法 python 3 中 9 / 3 结果为 3.0 如果想和python 2 一样进行地板除(建议搜索一下何为地板除),那么需要这样, 9 // 3
// 地板除 9 // 2 结果为4
** 乘方 2 ** 3 结果为 8。相当于import math math.pow(2, 3)。
% 取余或取模运算符,即求出除法后的余数。
% 取余或取模运算符,即求出除法后的余数。

![](operator.png)

## 算术表达式和运算符优先级

Expand Down

0 comments on commit a1e1335

Please sign in to comment.