title: How to append the result of an if statement in python
body: <p>I am trying to create basic survey program that asks questions and takes a numerical result from the answer and finds the average. i.e. A=10, B=5, C=0. I'm having two basic problems, the first and more important is adding the result to the list. The second is a formatting issue: I keep receiving an 'unexpected indent' or 'indent does match outer indentation layer' error on the append lines. I would appreciate any thoughts.</p>
  <h1>analyzing simple survey data for political affiliation</h1>
  <pre><code>voter = list()
  
  
  def question_1(x):
      if x == &quot;A&quot;:   
          print 10
          voter.append(10)   
      elif x == &quot;B&quot;:
          print 5
          voter.append(5)
      elif x == &quot;C&quot;:
          print 0
          voter.append(0)
      else:
          print &quot;Not a valid answer&quot;
   
  
  def question_2(y):  
      if y == &quot;A&quot;:
          print 10
          voter.append(10)
      elif y == &quot;B&quot;:
          print 5
          voter.append(5)
      elif y == &quot;C&quot;:
          print 0
          voter.append(0)
      else:
          print &quot;Not a valid answer&quot;
  
  
  def question_3(z):
      if z == &quot;A&quot;:
          print 10
          voter.append(10)
      elif z == &quot;B&quot;:
          print 5
          voter.append(5)
      elif z == &quot;C&quot;:
          print 0
          voter.append(0)
      else:
          print &quot;Not a valid answer&quot;
  
  
  def question_4(a):
      if a == &quot;A&quot;:
          print 10
          voter.append(10)
      elif a == &quot;B&quot;:
          print 5
          voter.append(5)
      elif a == &quot;C&quot;:
          print 0
          voter.append(0)
      else:
          print &quot;Not a valid answer&quot;
  
  
  def question_5(b):  
      if b == &quot;A&quot;:
          print 10
          voter.append(10)
      elif b == &quot;B&quot;:
          print 5
          voter.append(5)
      elif b == &quot;C&quot;:
          print 0
          voter.append(0)
      else:
          print &quot;Not a valid answer&quot;
  
  
   def get_average():
      average = sum(voter)/len(voter)
      print average 
  
  question_1(raw_input('what is your position on issue 1: A, B, or C'))
  question_2(raw_input('what is your position on issue 2: A, B, or C'))
  question_3(raw_input('what is your position on issue 3: A, B, or C'))
  question_4(raw_input('what is your position on issue 4: A, B, or C'))
  question_5(raw_input('what is your position on issue 5: A, B, or C'))
  
  get_average()
  </code></pre>