💡
5
c/coding-for-beginners•janah83janah83•1mo ago

Realized I was nesting functions backwards for 3 months

I was working on a Python project last week where I had to process a list of numbers. I kept nesting functions like print(sorted(list)) but nothing was outputting right. My friend looked over my shoulder and said 'you're calling sorted on a list that's already empty because print runs first.' That's when it clicked I was ordering my operations wrong. Has anyone else had a moment where the order of your code messed everything up?
3 comments

Log in to join the discussion

Log In
3 Comments
jakejones
jakejones1mo ago
Happens to everybody, it's not that deep.
4
the_wendy
the_wendy1mo ago
Did you ever try to microwave a burrito and end up with one side frozen and the other side lava hot? I did that last week and spent twenty minutes picking at it like a weirdo. Sometimes things just don't turn out as planned, you know?
4
jessica130
jessica1301mo ago
See I gotta disagree with you @jakejones, I think it actually kind of is that deep when you spend 20 minutes picking at a sad burrito. It's like a little reminder that not everything goes perfect and that's fine, you know? Makes you appreciate the ones that actually heat up right.
8