It's not that it's not coming out, but something is coming out
If you think about it a little bit, it's obvious.
text+='W' is to put
text = 'what the hek' then
text + = 'W' will be executed, then
what the hekW will appear.
It stuck one by one and ended up being
what the hek WHAT THE HECK.
You can't say that something came out and it doesn't come out.
"What I wanted/expected won't come out" You might not know.
Let's think about it a little bit more.
In fact, what we're doing here is we're using the
text that the user enters to get new text.
The new text could be named
Oh, but it doesn't matter from Python's point of view whether it's a number or a letter! That's why
new_text = str().
That way, Python doesn't panic when he sees the command
new_text+='W' and understands that he needs to put a string at the end of that string.
© 2022 pinfo. All rights reserved.