title: Vector input gives output vector `[0,...,0]` in Python
body: <p>I'm trying to create a vector class in Python. I'm not so far yet, and stuck already. </p>
  
  <p>This is my current code:</p>
  
  <pre><code>    class vector:
  
          def __init__(self, n, l = []):
              self.v = []
              if(isinstance(n, int)):
                 x = int(n)
                 if (x &lt; 0):
                     return SyntaxError
                 else:
                     self.v += [0.0] * x
              else:
                 self.v += n
  
          def __str__(self):
              return str(self.v)
  </code></pre>
  
  <p>The problem is, that when my input is </p>
  
  <pre><code>    &gt;&gt;&gt; u = vector(3,3.14)
      &gt;&gt;&gt; print(u)
  </code></pre>
  
  <p>then my ouput is </p>
  
  <pre><code>    [0.0, 0.0, 0.0] 
  </code></pre>
  
  <p>But I want it to be </p>
  
  <pre><code>    [3.14,3.14,3.14]
  </code></pre>
  
  <p>and I also want the following:</p>
  
  <pre><code>    &gt;&gt;&gt; v=[3,[2.0,3.14,-5])
      &gt;&gt;&gt; print(v)
      [2.0,3.14,-5]
  </code></pre>
  
  <p>What is the problem in my script?</p>
  
  <p>Thanks!</p>