+ 2
23 // 2 ???
what if I devide 23 // 2 ? I know it will give an int but how to know what's the result. if there's any
9 odpowiedzi
+ 7
x / y float; quotient of x and y; 23/2=11.5
x // y int; quotient of x and y; 23//2=11
x % y int; remainder of x / y; 23%2=1
+ 5
23/2=11.5
23//2=11
+ 1
It returns the integer part of the division result. If you divide 23 by 2 you get 11.5. Here 11 is the integer part. So 23 // 2 = 11.
+ 1
thanks. really appreciate it
+ 1
// is floor division . Divides and the drops the remaining fraction.
11 / 4 = 2.75
11 // 4 = 2
+ 1
// only give you the strung number so 23//2 = 11 but 23 /2 give you 11.5
that's only on python 3
0
a = 11/2
b = 11//2
print (a)
print (b)
Will print the answer of both in the terminal or python IDE etc.
0
23/2=11.5
23//2=11
0
23//2 will give you 11 as // operator returns integer