title: Assigning numbers via user input in list as integer in Python
body: <p>here’s the program</p>
  
  <pre><code>assignments = (input(“assignments:”).split(",") #enter number separeted by comma
  print(type(assignments[0]))
  </code></pre>
  
  <p>output is class <code>str</code></p>
  
  <p>how to save the numbers as integers not as string,<br>
  I have tried   </p>
  
  <pre><code>assignments = int(input("assignments:")).split(",")
  </code></pre>
  
  <p>but it gives me error </p>
  
  <blockquote>
    <p>ValueError: invalid literal for int() with base 10: #numbers which I
    enter</p>
  </blockquote>