This is incorrect. You are not defining a or b. You are defining c as either a or b.
Declarative way: c = condition ? a : b
Imperative way:
c = null
if condition:
c = a
else:
c = b