Two things I’d still want to poke at.
1) You’re ignoring
i from the for-loop. A while-loop would be more suitable.
2) Strings are immutable. Can’t be changed. That means you’re not adding characters, you’re creating a whole new string with an additional character. (A lot of copying for large text). The way around this is to place the characters in a list which does support adding, and then create a string when all the characters are known.
I’d still accept it if that was for me to decide, it’s fine for small input, making it look nice is about experience and knowing more ways to express things, and it’s an absolutely silly thing to implement in python which already facilitates this kind of thing:
(Which of course isn’t an appropriate solution, since it avoids implementing it)
It gets difficult to say what should be allowed or not, and the nicer the code is supposed to be, the more it’ll be like cheating
Oh yeah and, some python implementations will cheat here, and actually will add to the string rather than making a copy. They can do this because they see that there are no other references to the string, nobody could possibly tell the difference (aside from the speed difference)