title: Printing a range on the same line, and ending with a newline (Python)
body: <p>I am working on a homework assignment, and I managed to get most of the code (at least I think so).  But when I go to submit the assignment, my textbook wants my output to end in a newline.<br />
  Assignment: Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer.</p>
  <p>Ex: If the input is:</p>
  <p>-15
  10
  the output is:</p>
  <p>-15 -10 -5 0 5 10
  Ex: If the second integer is less than the first as in:</p>
  <p>20
  5
  the output is:</p>
  <p>Second integer can't be less than the first.</p>
  <p>My code:</p>
  <pre><code>x = int(input())
  y = int(input())
  
  if y &gt;= x:
      for i in range(x, y+1, 5,):
          print(i, end=' ')
  else:
      print('Second integer can\'t be less than the first.')
  </code></pre>
  <p><a href="https://i.stack.imgur.com/xRvei.png" rel="nofollow noreferrer">This is where my problem lies.</a></p>
  <p>How can I fix this?</p>