Skip to main content
1 of 2
Mathieu Guindon Mod
  • 75.1k
  • 4
  • 98
  • 241

Following the editing-out of the last sentence (which I've approved), I've reopened the question.

OP is clearly interested in improving their code, and barring that last sentence the post in on-topic, and the edit does not warp the OP's intent.

I've approved an edit that makes your question perfectly fine. If you want to ask specifically why it's echoing and how to avoid that, feel free to ask that specific question on Stack Overflow. – Mathieu Guindon♦ just now

That said I don't agree with the assessment of incomptence and intentions-interpreting going on here. Often a first-time poster will present code for illustrative purposes only to depict the specific problem they're asking about, and aren't really interested in a review or in improving their code. If all they wanted was an answer to the echoing question, then no edit could have salvaged it: it's indeed usually better to let the OP fix their question themselves, with proper guidance in the comments.

Mathieu Guindon Mod
  • 75.1k
  • 4
  • 98
  • 241