I\'m a little curious about the difference between if and inline if, in Python. Which one is better?
Is there any reason to use inline if, other than the f
Inline if is an expression, so you can not put assignments inside.
Correct syntax would be:
a = a*2 if b == 2 else a/w
As for the usefulness, it's a question of style, and perhaps it would be a good question for Programmers StackExchange.