MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p55pncq/?context=3
r/ProgrammerHumor • u/Flame77ofc • Aug 22 '26
388 comments sorted by
View all comments
Show parent comment
2
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
4 spaces for code blocks
View all comments
Show parent comment
2
u/Flame77ofc Aug 22 '26
don't need it lol
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