title: Why do I keep getting a syntax error message (in Python) when using append?
body: <p>The syntax error is at line 9. </p>
  
  <pre><code># -*- coding: UTF-8 -*-
  import math
  x = []
  y = []
  n = raw_input('How many points: ')
  number = n
  while n &gt; 0:
    x.append(input('enter x: ')
    y.append(input('enter y: ')
    n = n - 1
  d = []
  n = number
  while n &gt; 0:
    d.append(math.sqrt((x[n-1] - x[n-2])**2 + (y[n-1] - y[n-2]**2
    n = n - 1
  d.append(math.sqrt((x[number-1] - x[0])**2 + (y[number-1] - y[0]**2
  p = 0
  n = number
  while n &gt; 0:
    p = p + d[n-1]
    n = n - 1
  print(‘Perimeter =’)
  print(p)
  input(‘Press 0 and then enter to continue:’)
  </code></pre>
  
  <p>What am I doing wrong? Also, I am only a beginner in Python, so an easy to understand explanation would be helpful. </p>
  
  <p>This is what is popping up in my terminal:</p>
  
  <pre><code>File "prg1.py", line 9
      y.append(input('enter y: ')
      ^
  SyntaxError: invalid syntax
  </code></pre>