what is the use of // operator in Python? Can anyone explain?

0 votes

Hi,

I am new to python and still going through a learning phase, can anyone explain what is the use of // operator in Python?

Thanks.

Jun 23 in Python by Roshni
• 4,630 points
61 views

1 answer to this question.

0 votes

Hi, @Roshni,

It is a Floor Divisionoperator, which is used for dividing two operands with the result as quotient showing only digits before the decimal point. For instance:

10//5 = 2 

and 

10.0//5.0 = 2.0.

Hope this helps.

answered Jun 23 by Gitika
• 41,360 points

Related Questions In Python

0 votes
1 answer

What is the use of '==' operator in dictionary in Python?

Yes you can use '==' operator to ...READ MORE

answered Jul 24, 2019 in Python by Arvind
• 2,980 points
76 views
0 votes
1 answer

Can you explain what is the use _init_ and self in python?

Hi, The basic difference between these two are _init_ ...READ MORE

answered Aug 14, 2019 in Python by anonymous
332 views
+2 votes
3 answers

what is the practical use of polymorphism in Python?

Polymorphism is the ability to present the ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
2,442 views
0 votes
1 answer

What is the use of raw_input function in Python?

raw_input fuction is no longer available in ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
267 views
0 votes
0 answers

what is a bitwise operator in python?

can you show some operations using bitwise ...READ MORE

Apr 8, 2019 in Python by Waseem
• 4,540 points
66 views
0 votes
0 answers

what is the logical AND operator in python?

how do i use it in a ...READ MORE

Apr 12, 2019 in Python by Waseem
• 4,540 points
76 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,453 views
0 votes
1 answer
0 votes
1 answer

What is the purpose of ​#!/usr/bin/python​on the first line in the above code?

Hey, @Roshni, By specifying #!/usr/bin/python you specify exactly ...READ MORE

answered Jun 23 in Python by Gitika
• 41,360 points
65 views