Python程序教程

您现在的位置是:首页 >  Python

当前栏目

python中/和//的区别

python,区别
2025-04-07 09:01:26 时间

大家好,又见面了,我是你们的朋友全栈君。

“ / ” 为浮点数除法,返回浮点结果

“ // ” 表示整数除法,返回不大于结果的一个最大整数

print("6 / 4 =" + str(6 / 4))       //1.5
print("6 // 4 =" + str(6 // 4))    //1

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/155955.html原文链接:https://javaforall.cn