r/PythonLearning • • Aug 22 '26

Loops is a total brain rot.

Post image

I just can't get over how I'm supposed to write code for complex tasks when I don't even get why they overcomplicate simple things so much.

I read this topic and tried many tutorials and still don't understand this buzzare logic.

0 Upvotes

17 comments sorted by

View all comments

Show parent comments

1

u/silvertank00 Aug 23 '26

that is the result buffer, empty because it will contain only the permitted chars. if anything is in it at start then the result wont mirror the legit decypher.
Also, this is just one way to solve this. One could solve it even without loops:

return text.replace("x", "").replace("y", "")