3 ms·
It saves a character in code golf, but as others have pointed out, it's unsafe. a if b else c #+1 byte a and b or c #buggy (c,b)[not a] #ok in ge
by klyrs 5y ago
It saves a character in code golf, but as others have pointed out, it's unsafe.
a if b else c #+1 byte
a and b or c #buggy
(c,b)[not a] #ok in general
a and 1or c #-1 byte if b is a constant
(b,c)[a] #-4 byte if a is boolean