views:

301

answers:

5

What does this mean in python:

sock.recvfrom(2**16)

I know what sock is and I get the jest of recvfrom function, but what the hell is 2**16?

+18  A: 

It is the power operator, see this reference:

http://www.webreference.com/programming/python/

It is equivalent to 216 = 65536

rossoft
In Python (the scope of the OP's) question, 2 ** 16 evaluates to 65536, while 2 ^ 16 evaluates to 18. You appear to attach a strange meaning to "is equivalent to".
John Machin
@John: That is why he didn't actually post "2 ^ 16" -_-
DoR
@Pynt: You are gravely mistaken, @rossoft did actually post "2 ^ 16"; subsequent to my comment, @kaiser.se edited the answer to read what you see now, effectively 2<superscript>16</superscript>. You can verify this by clicking on the clickable part of "edited N hours ago".
John Machin
Yeah, I figured that was the case...after I had already posted my comment:P
DoR
Exactly, thanks kaiser.se for the edit
rossoft
+3  A: 

2 raised to the 16th power

jwilson
+2  A: 

I believe that's the power operator, such that 2**5 = 32.

MikeSep
+1  A: 

It is the awesome power operator which like complex numbers is another thing you wonder why more programming languages don't have.

Tendayi Mawushe