0 votes
in Python by
What’s the difference between / and // in Python?

1 Answer

0 votes
by
Both / and // are division operators. However, / does float division, dividing the first operand by the second. / returns the value in decimal form. // does floor division, dividing the first operand by the second, but returns the value in natural number form.

/ example: 9 / 2 returns 4.5

// example: 9 / 2 returns 4

Related questions

0 votes
asked Sep 9, 2022 in Python by john ganales
0 votes
asked Feb 10, 2021 in Python by SakshiSharma
...