Python 运算符“/”与“//”

Ayu*_*ush 13 operators python-3.x

我在我正在学习的 Python 教程中遇到了使用//运算符代替的情况。Python 中的and运算/符有什么区别?///

pra*_*upd 18

在 Python 3.0 及更高版本中,检查您的终端。

\n

A)/运算符,又名经典除法

\n
>>> 5/2\n2.5\n
Run Code Online (Sandbox Code Playgroud)\n

b)//操作员,又名楼层划分

\n
>>> 5//2\n2\n
Run Code Online (Sandbox Code Playgroud)\n

参考

\n

9.9. 运算符 \xe2\x80\x94 作为函数的标准运算符

\n