title: TypeError: can only concatenate tuple (not "int") in Python
body: <p>I am going to need your help with this constant tuple error I keep getting. Seems that it is a common mathematical error that many have. I have read almost every instance of TypeError including 'not int', 'not list', 'not float' etc. Yet I have failed to figure out why I get it. </p>
  
  <p>I have written the below code that allows you to enter the sum of random number and in the end it calculates your success ratio. So I have a counter "right=right+1" to count my correct answers. Seems as if Python doesn't like that.</p>
  
  <p>Here is what I have written:</p>
  
  <pre><code>import random 
  #the main function
  def main():
      counter, studentName, averageRight, right, answer, number1, number2 = declareVariables() 
      studentName = inputNames()
  
      while counter &lt; 10:
          number1, number2 = getNumber()
          answer = getAnswer(number1, number2, answer)
          right = checkAnswer(number1, number2, answer, right)
          counter = counter + 1
      results(right, averageRight)
      displayInfo(studentName, right, averageRight)
  
  def declareVariables():
      counter = 0
      studentName = 'NO NAME'
      averageRight = 0.0
      right = 0.0
      answer = 0.0
      number1 = 0
      number2 = 0
      return counter, studentName, averageRight, right, answer, number1, number2
  
  def inputNames():
      studentName = raw_input('Enter Student Name: ')
      return studentName
  
  def getNumber():
      number1 = random.randint(1, 500)
      number2 = random.randint(1, 500)
      return number1, number2
  
  def getAnswer(number1, number2, answer):
      print 'What is the answer to the following equation'
      print number1
      print '+'
      print number2
      answer = input('What is the sum: ')
      return answer
  
  def checkAnswer(number1, number2, answer, right):
      if answer == number1+number2:
          print 'Right'
          right = right + 1
      else:
          print 'Wrong'
  
      return right, answer
  
  def results(right, averageRight):
      averageRight = right/10
      return averageRight
  
  
  
  def displayInfo(studentName, right, averageRight):
      print 'Information for student: ',studentName
      print 'The number right: ',right
      print 'The average right is: ', averageRight
  
  # calls main
  main()
  </code></pre>
  
  <p>and I keep getting:</p>
  
  <pre><code>Traceback (most recent call last):
    File "Lab7-4.py", line 70, in &lt;module&gt;
      main()
    File "Lab7-4.py", line 15, in main
      right = checkAnswer(number1, number2, answer, right)
    File "Lab7-4.py", line 52, in checkAnswer
      right = right + 1
  TypeError: can only concatenate tuple (not "int") to tuple Press any key to continue . . .
  </code></pre>