0

What does ** or // represents in pythons ?

i got a question like 2**2//3 then whats this output ??

23rd May 2017, 11:24 AM
Rahul Gupta
Rahul Gupta - avatar
2 odpowiedzi
+ 5
a**b gives the power of a^b e.g 2**2 = 2*2 = 4 2**3 = 2*2*2 = 8 And the // means that you want to make an integer division instead of a floating division. e.g 5/2 = 2.5 5//2 = 2
23rd May 2017, 11:32 AM
Tim G
Tim G - avatar
+ 2
** represents power // represents division simply
23rd Jul 2017, 8:59 AM
Naga pratyusha
Naga pratyusha - avatar