3 ms·
But in many imperative languages you would equally use a ternary operator? c = condition ? a : b And in Python at least, it would be: if condition:
by Simran-B 4y ago
But in many imperative languages you would equally use a ternary operator?
c = condition ? a : b
And in Python at least, it would be:
if condition:
c = a
else:
c = b
(i.e. no upfront declaration of c)