i = 100
a = 1 if i < 100 else 2 if i > 100 else 0
a
i = 101
a = 1 if i < 100 else 2 if i > 100 else 0
a
i = 99
a = 1 if i < 100 else 2 if i > 100 else 0
a
Python putting an if-elif-else statement on one line