Shady_Shiroe@lemmy.world to Programmer Humor · 1 year agoCall the Priestlemmy.worldimagemessage-square24fedilinkarrow-up197arrow-down16
arrow-up191arrow-down1imageCall the Priestlemmy.worldShady_Shiroe@lemmy.world to Programmer Humor · 1 year agomessage-square24fedilink
minus-squareCalcharger@kbin.sociallinkfedilinkarrow-up7arrow-down1·1 year agoFor x in range(∞): If x % 2 == 0: Print(‘Even’) Else: Print(‘Opposite of even’)
minus-squaredrowned Phoenician@feddit.delinkfedilinkarrow-up1·1 year agoFor more pythinic code, the considerate programmer will use the fact that 0 is falsy: if x % 2: print("odd") More confusion is more python
For x in range(∞):
If x % 2 == 0:
Print(‘Even’)
Else:
Print(‘Opposite of even’)
how…odd
😎
For more pythinic code, the considerate programmer will use the fact that 0 is falsy:
if x % 2: print("odd")
More confusion is more python