Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 5 months agoModern Programminglemmy.zipimagemessage-square45fedilinkarrow-up1503arrow-down18
arrow-up1495arrow-down1imageModern Programminglemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 5 months agomessage-square45fedilink
minus-squareoni ᓚᘏᗢ@lemmy.worldlinkfedilinkarrow-up11·5 months agoI love something = condition and result1 or result2 in lua
minus-squareRandelung@lemmy.worldlinkfedilinkarrow-up10·edit-25 months agoPython does that, too. https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not
minus-squareSatyrSack@lemmy.sdf.orglinkfedilinkarrow-up1arrow-down1·5 months agoAre you just referring to how Python uses the English and/or instead of the more common &&/||? I think what the user above you was talking about was Lua’s strange ternary syntax using and/or.
minus-squareoni ᓚᘏᗢ@lemmy.worldlinkfedilinkarrow-up1·edit-25 months agooften I do a function called elvis XD with the next signature elvis(condition, res1, res2)
I love
something = condition and result1 or result2in luaPython does that, too.
https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not
Are you just referring to how Python uses the English
and/orinstead of the more common&&/||? I think what the user above you was talking about was Lua’s strange ternary syntax usingand/or.often I do a function called elvis XD with the next signature
elvis(condition, res1, res2)