Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 6 days agoModern Programminglemmy.zipimagemessage-square12linkfedilinkarrow-up17arrow-down10
arrow-up17arrow-down1imageModern Programminglemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 6 days agomessage-square12linkfedilink
minus-squareentropicdrift@lemmy.sdf.orglinkfedilinkarrow-up1·6 days agoprint("odd" if num % 2 else "even") That’s the native python version, for those curious
minus-squareDreadPirateShawn@lemmy.blahaj.zonelinkfedilinkarrow-up1·6 days agoThe ternary syntax is really my only real gripe with python design – putting the conditional BETWEEN the true and false values feels so very messy to me.
print("odd" if num % 2 else "even")
That’s the native python version, for those curious
The ternary syntax is really my only real gripe with python design – putting the conditional BETWEEN the true and false values feels so very messy to me.
Why is the return first?