This is how the post looked when I opened it to edit and fix problems:
And here it is after:
I used an image editor to circle the {}
button so that you can see exactly where it is.
To use this button, first select the text that should be the code, and then press the button. Or you can select the text, and then press Ctrl+K.
I fixed the post by removing the >
symbols, which come from using the quote feature (the "
button, to the left of the {}
) in the same way. I also fixed some other small problems with how the question is written, in order to show what good Stack Overflow questions should look like. (But a good question also needs to be properly researched, and the problem needs to be clearly defined and reproducible.)
It does not matter what buttons you click, or what you press on the keyboard, or what you see in rich text mode. Stack Overflow only cares about the text that is shown in the Markdown editor when you submit the post.
For future questions, please do not show us an image. We will not transcribe the image for you (copy out the text and format it for you).
It's also helpful to read error messages carefully and try to reason about the problem. It did not help when you changed the variable name lines
to a different name, because that was not the problem. The error message says there is a problem because something "is not callable". That means, you tried to call something, and it is not possible to call that thing. When you write str(lines)
, the thing that you call is str
, and lines
is what you call it with. Therefore, we know that the problem must be with str
, not with lines.
Normally, str
should be callable; the meaning is built in to Python. But it's possible to replace this (in other code that you did not show in the post). Your question is very commonly asked by beginners, so we closed it as a duplicate. We have an existing question that explains very carefully how this problem happens, why it is possible, and what to do about it.
Disclosure: I did a lot of work to try to improve the question and answers there. There are some other old questions that are about as popular and almost exactly the same. We did not come to a clear agreement about which one to use to answer beginners.