The role and usage of / and // in python

In Python syntax, / is a division, for example: 2/3 = 0.6666. And // means division by rounding down, for example, 3 // 2 = 1, 6.0 // 4 = 1. That is, / returns a floating-point type result, and // returns an integer result (can be understood as the integer part of /).

Published 943 original articles · Like 136 · Visit 330,000+

Guess you like

Origin blog.csdn.net/weixin_36670529/article/details/105146470