+ 1

what is // and _

23rd Sep 2016, 7:50 AM
kaleab
kaleab - avatar
3 Réponses
+ 2
// is the euclidian division. _ is not an operator.
23rd Sep 2016, 8:36 AM
Zen
Zen - avatar
+ 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.
24th Sep 2016, 2:25 AM
Frank Columbus
0
remainder of division
4th Oct 2016, 5:15 AM
ChaosMuffin