Do spaces in python expressions do anything?

So what would the computer do if you input “6**6” vs. “6 ** 6”?
Basically, what is the difference of inputting the spaces vs. omitting them?

Thank you!

2 Likes

I don’t think there’s a difference at all.

But it’s better to use spaces as if you are writing in a paper to make everything look neat and organized.

1 Like

Exactly.

To make code readable and mistakes easy to spot, always use whitespace around operators, like the second example. There is no mistaking what operation is taking place, here.

4 Likes