title: How to input elements in list in one line seperated by space?
body: <p>I have a list which takes n elements as input in it. Everything is fine but I want to take the input in same line separated by space. How can I modify my below code?</p>
  
  <pre><code>a = int(input("Enter size of list: "))
  print("Enter elements:")
  l = [int(input()) for i in range(a)]    
  print(l)
  </code></pre>
  
  <p>My output:</p>
  
  <pre><code>Enter size of list: 3
  Enter elements:
  1
  2
  3
  [1, 2, 3]
  </code></pre>
  
  <p>I want it to look like this:</p>
  
  <pre><code>Enter size of list: 3
  Enter elements:
  1 2 3
  [1, 2, 3]
  </code></pre>
  
  <p>I had tried this one (<a href="https://stackoverflow.com/questions/25910255/input-n-elements-seperated-by-space-in-python">Input n elements seperated by space in python</a>) but it didn't satisfied what I need because it's for a dynamic list but I want for a static list according to my code.</p>