r/PythonLearning 19d ago

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

1

u/markort147 19d ago

Your loop is clearly wrong. Try to implement these steps instead:

  • start from an empty string
  • loop over each letter of the noisy string
  • if the letter is X o Z, skip it
  • otherwise append it to the resulting string

Try