+ 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

29th Dec 2016, 10:32 AM
Haythem Drihmi
Haythem Drihmi - avatar
9 Réponses
+ 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
29th Dec 2016, 11:09 AM
Brt
+ 5
23/2=11.5 23//2=11
29th Dec 2016, 2:01 PM
Lakshmi Sahithi.Bhuvanagiri
+ 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.
29th Dec 2016, 10:52 AM
Mahir Asef Kabir
Mahir Asef Kabir - avatar
+ 1
thanks. really appreciate it
29th Dec 2016, 10:54 AM
Haythem Drihmi
Haythem Drihmi - avatar
+ 1
// is floor division . Divides and the drops the remaining fraction. 11 / 4 = 2.75 11 // 4 = 2
29th Dec 2016, 3:53 PM
Jess Wolfe
Jess Wolfe - avatar
+ 1
// only give you the strung number so 23//2 = 11 but 23 /2 give you 11.5 that's only on python 3
7th Jan 2017, 1:23 AM
Wesam Fathy Mahmoud
Wesam Fathy Mahmoud - avatar
0
a = 11/2 b = 11//2 print (a) print (b) Will print the answer of both in the terminal or python IDE etc.
29th Dec 2016, 10:30 PM
Paul Bartholomew
0
23/2=11.5 23//2=11
23rd Jan 2017, 4:10 PM
FAGO LION
FAGO LION - avatar
0
23//2 will give you 11 as // operator returns integer
6th Feb 2017, 4:16 PM
Avnit Sharma
Avnit Sharma - avatar