title: Print all numbers less than the last number in a list in python
body: <p>How can I print only the numbers that are less than the last number in the list?</p>
  <p>I am trying to print all numbers less than the last number in a list using python. The list is based on user input. Example numbers for user input are:</p>
  <pre><code>5
  40
  50
  160
  300
  75
  100 (the last number)
  </code></pre>
  <p>I do not want to print the first or the last number. The first number lists how many numbers in the list to check. My code is only providing the current numbers in the list. I can't figure out how to only get the numbers that are less than the last number in the list. I do not want to use functions or an array. This needs to be for/while/else/if/range or something in that realm.</p>
  <pre><code>lst = [] #the list 
  n = int(input()) #user input
    
  for i in range(-1, n):
      ele = int(input())
      lst.append(ele) # adding the element'
  
  print(*lst, sep = &quot;\n&quot;)
  </code></pre>