title: How to solve "TypeError: tuple indices must be integers or slices" error in Python?
body: <p>I have a <code>student</code> class that takes attributes and has getter and setter methods and a function called <code>getTheFirstInClass()</code>  that takes a list of grades and returns the highest grade.</p>
  
  <p>But the system display this error:</p>
  
  <blockquote>
    <p>File "C:\Users\test\student.py", line 30, in <br>
    std1.getTheFirstInClass(2.4,4.2,5.6,2.2,1.2) File
    "C:\Users\test\student.py", line 20, in getTheFirstInClass   if
    grades[i] > maxValue:</p>
    
    <p>builtins.TypeError: tuple indices must be integers or slices, not student</p>
  </blockquote>
  
  <h1>student.py:</h1>
  
  <pre><code>class student():
      def __init__(self,name,age, grade):
          self.stdName=name
          self.stdAge = age
          self.stdGrade = grade
  
      def getName(self):
          print("the student name {}".format(self.stdName))
  
      def getAge(self):
          print("the student age :{}".format(self.stdAge))
  
      def getGrade(self):
          print("the student {0}, have a grade {1}".format(self.stdName,self.stdGrade))
  
      def getTheFirstInClass(*grades:float):
          maxValue = 0
          for i in grades:
              if grades[i] &gt; maxValue:
                  maxValue = grades[i]
                  i+=1
          return maxValue
  
  std1 = student("georges", 17, 3.4)
  std1.getName()
  std1.getAge()
  std1.getGrade()
  
  std1.getTheFirstInClass(2.4,4.2,5.6,2.2,1.2)
  </code></pre>