"**" in python

llanitedave llanitedave at birdandflower.com
Sun Nov 23 21:30:13 EST 2014


On Sunday, November 23, 2014 5:49:05 PM UTC-8, Skip Montanaro wrote:
> I want to add one more thing to the other responses. People new to Python often seem unaware that being an interpreted language, often the best way to figure something out is to simply try it at the interpreter prompt. The OP saw "var ** 2" in done code. The most obvious thing to me would have been to type
> 
> var = 42
> 
> var ** 2
> 
> and see what happened. It's unlikely to trigger a nuclear meltdown, or even crash the interpreter.
> 
> Skip


I dunno, if it took 7.5 million years to come up with the answer in the first place, imagine how long it might take to square it!



More information about the Python-list mailing list