How to use Ternary Operator in Python?