Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 7 days agoModern Programminglemmy.zipexternal-linkmessage-square70fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkModern Programminglemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 7 days agomessage-square70fedilink
minus-squarejacksilver@lemmy.worldlinkfedilinkarrow-up0·7 days agoI think the idea is it reads more naturally, so you can read it like this return A if statement is true else return B
minus-squareNalivai@discuss.tchncs.delinkfedilinkEnglisharrow-up0·5 days agoIs it really more natural for a non-programmer than “if statement is true than a else b”? I can’t evaluate because of decades of C, so for me the python logic is still bizarre.
I think the idea is it reads more naturally, so you can read it like this
return A if statement is true else return B
Is it really more natural for a non-programmer than “if statement is true than a else b”? I can’t evaluate because of decades of C, so for me the python logic is still bizarre.
Yep, it’s this