What does "//" mean? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What does "//" mean?

25th Nov 2017, 6:06 AM
SACHIN JOSEPH
6 Answers
+ 7
Unless you are talking about a mathematical operator for floor division :) Then it returns an integer which is next lowest to the regular division result: 13 / 4 = 3.25 13 // 4 = 3
25th Nov 2017, 6:26 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
It is a comment. "//" starts a single line comment ( a comment that is one line long ). You can't see a comment in the actual output of the code, but it is there. Comments are often used to explain to others what your code is doing, or to remind yourself about what you are doing in part of your program. It's good practice to use comments in your code. It's also used for division in Python: 40//2 outputs 20 Sorry this is so long 😅 Happy Coding! 😃
25th Nov 2017, 6:21 AM
Learnsolo
+ 3
Thankyou
25th Nov 2017, 6:25 AM
SACHIN JOSEPH
+ 1
IN JAVA Comments :- The line following // is just for comments, used to explain what you have done or to write anything stupid. They don't produce an error like any random text in code.
25th Nov 2017, 6:08 AM
Meharban Singh
Meharban Singh - avatar
+ 1
It's used to show the existence of a comment on that line
25th Nov 2017, 6:15 AM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 1
// This is a comment It is also used for returning quotient in python eg. 30//2 = 15
25th Nov 2017, 6:28 AM
#RahulVerma
#RahulVerma - avatar