Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 1 month agoModern Programminglemmy.zipimagemessage-square19linkfedilinkarrow-up12arrow-down10
arrow-up12arrow-down1imageModern Programminglemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 1 month agomessage-square19linkfedilink
minus-squareentropicdrift@lemmy.sdf.orglinkfedilinkarrow-up1·1 month agoprint("odd" if num % 2 else "even") That’s the native python version, for those curious
minus-squareDreadPirateShawn@lemmy.blahaj.zonelinkfedilinkarrow-up1·1 month 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.
minus-squareidunnololz@lemmy.worldlinkfedilinkarrow-up0·1 month agoAt least you guys have ternary syntax cries in kotlin.
minus-squareaubeynarf@lemmynsfw.comlinkfedilinkarrow-up1·24 days agoin Scala, everything is an expression, including “if”, maybe kotlin is the same?
minus-squarebalsoft@lemmy.mllinkfedilinkarrow-up0·edit-21 month agoEh, reads pretty naturally to me. That said, (like I lisp)
minus-squareShareni@programming.devlinkfedilinkarrow-up1·1 month agoLisps makes more sense to me though (if condition a b) VS a if condition else b
minus-squareKaboom@reddthat.comBannedlinkfedilinkarrow-up0arrow-down1·1 month agoWhy is the return first?
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.
At least you guys have ternary syntax cries in kotlin.
in Scala, everything is an expression, including “if”, maybe kotlin is the same?
Eh, reads pretty naturally to me. That said,
(like I lisp)
Lisps makes more sense to me though
(if condition a b)
VS
a if condition else b
Why is the return first?