Is there a way to avoid a new line while using `end=`
<p>I've just started using python and I'm creating a simple program that will ask whoever the user is a question and then from the text file I will extract a specific line and print that line and along with the line - at the end I will add their answer. here's the code.</p>

<pre><code>    question = input("do you want to print the line")
    if "yes" in question:
        print(open("tp.txt").readlines()[:10][-1],end=question) 
</code></pre>

<p>The issue is that <code>,end=question)</code> puts the users answer on a new line. I know that <code>end=</code> is the same as <code>\n</code>. So I'm just wondering is there a way or an alternative to stop 'end=' from automatically creating a new line?</p>

<pre><code> print(open("tp.txt").readlines()[:10][-1],
</code></pre>

<p>is the way I open and read a specific line from the file
since its a 'nice' shortcut to do than rather do<code>with open (filename.txt,'r') as f:</code></p>

<p>Have you tried simply omitting the "end="?
I don't think it's necessary you put it there.</p>

python python-3.5