// and **? what does it do? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

// and **? what does it do?

What does // and ** do in python?

19th Sep 2017, 9:35 AM
aiden
2 Answers
+ 15
** Performs exponential (power) calculation on operators. a**b = a to the power b // is Floor Division i.e. The division of operands where the result is the quotient in which the digits after the decimal point are removed. But if one of the operands is negative, the result is floored, i.e., rounded away from zero (towards negative infinity): 9//2 = 4 -11//3 = -4
19th Sep 2017, 9:40 AM
Dev
Dev - avatar
+ 1
Pyton. // Floor division operand is very simple with positive digit. But don't mistake with negative digits! 9//4=2 11//3=3 -11//3=-4 10//3=3 -10//3=-4 10//-3=-4 9.01//3=3.0 9.01//-3=-4 9.01/3=3.00333333333334
28th Nov 2017, 3:36 PM
Jamol Makhsudov
Jamol Makhsudov - avatar