Skip to content
Advertisement

Tag: syntax

What’s the difference between “2*2” and “2**2” in Python?

What is the difference between the following statements? Statement 1: Statement 2: I see no difference. This raises the following question. Why is Statement 1 used if we can use Statement 2? Answer Try: and to see the difference. ** is the operator for “power of”. In your particular operation, 2 to the power of 2 yields the same as

Advertisement