+ 1
what is // and _
3 Antworten
+ 2
// is the euclidian division.
_ is not an operator.
+ 2
I believe this course calls it floor division. Think of it as the other half of modulo.
For example when first learned division but before you learned decimals, you wrote something like: 17 / 3 = 5 remainder 2.
The floor division operator // gives, 17//3 = 5
The modulo operator % gives, 17%3 = 2
The underscore is not an operator but it has a few other uses in Python such as "throw away variables" like a counter for a loop that has no other significance.
0
remainder of division