title: Python: How do I put print statement and input on same line?
body: <p>How can I make it that when the user enters input its on the same line as the print statement</p>
  
  <p>like for example for the code snippet below. The output becomes:</p>
  
  <pre><code>Enter grade for course 1: A
  Enter credits for course 1: 4
  </code></pre>
  
  <p>For now this is what I get:</p>
  
  <pre><code>Enter grade for course 1: 
  A
  Enter credits for course 1:
  4
  </code></pre>
  
  <p>Here is the code snippet   </p>
  
  <pre><code>for i in range(1,coursenumber+1):
      print("Enter grade for course ", i,":", end =""),
      grade=str(input())
      print("Enter credits for course", i,":", end =" ")
      credit=int(input())
      totalgpa+=translate(credit,grade)
      totalcredit+=credit
  </code></pre>