+ 1
How "//" works
4 Réponses
+ 3
// is floor division in Python. To put it simply,it will return the largest integer smaller or equal to the result of a regular division of a number.
Note that 5.5//5 gives 1.0 (1.1 to 1.0, 1.0<2.0). It is still a float number. -5.5//5 gives -2.0(-2.0<-1.0)
If you want a pure integer,import math and use math.floor(x/y) instead.
In C#, // indicates the start of a comment. / can already serve the above function.
+ 3
The // represent single line comments in several languages including C, C++, C#, JS, Java, Swift, Kotlin etc.
+ 1
Thank u