Take a look at the following snippet:
def foo(flag): |
Now, here are two possible evaluations. which one is correct?
> foo(True) |
> foo(True) |
In python the "hello", "world"
statement is implicitly evaluated as a tuple, which causes the confusion. foo
‘s statement can be interpreted in two different ways:
# option A |
So which one is correct? Option B -
> foo(True) |
Takeaways?
Explicit is better than implicit , and of course: