Sep-02-2018, 09:45 PM
looks like it violates PEP 20, but runs.
I don't see where the else is being interpreted as the 1st condition is satisfied.
reversed will give syntax error, because forced to run else code of first statement
I don't see where the else is being interpreted as the 1st condition is satisfied.
reversed will give syntax error, because forced to run else code of first statement
a=None; b='abc'; a + ' & ' b if a != None else c = b
Output: a=None; b='abc'; a + ' & ' b if a != None else c = b
^
SyntaxError: invalid syntax