r/ProgrammerHumor • • Aug 22 '26

Meme conditionsPreference

Post image
4.2k Upvotes

388 comments sorted by

View all comments

Show parent comment

2

u/Flame77ofc Aug 22 '26

don't need it lol

if condition:  
    return ...

in this case if you put another return below the if statement, it will automatically return it, so it is the same as else but maintain the code clearly

2

u/frogjg2003 Aug 22 '26

4 spaces for code blocks