title: Function x at 0x
body: <p>I have an assignment that requires me to get students gpa based off their points and hours. I'm having trouble getting python to return the gpa inside the class I created. This is the Class:</p>
  
  <pre><code>class Student:
  
      """Creates a student with the requirements of names, hours, and points, then
      calculates and returns the specific student's gpa"""
  
      def __init__(self, name, hours, points):
          self.name = name
          self.hours= float(hours)
          self.points = float(points)
          self.gpa = self.points/self.hours
  
      def getname(self):
          """Gets the name of the student"""
          return self.name
  
      def getpoints(self):
          """Get the points of the student"""
          return self.points
  
      def gethours(self):
          """Get the Hours of the student"""
          return self.hours
  
      def gpa(self):
          """Gets the GPA of the student"""
          return self.gpa
  </code></pre>
  
  <p>And the code that I use:</p>
  
  <pre><code>def main():
      filename = 'student.txt'
      infile = open(filename, 'r')
  
      gpa = []
      for line in infile:
          name, hours, points = line.split('\t')
          Student(name,hours,points)
          gpa.append(Student.gpa)
  
      print(gpa)
  
  main()
  </code></pre>
  
  <p>When ran the list returns something along the lines of</p>
  
  <blockquote>
    <p><code>[&lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;, &lt;function gpa at 0x04AE5780&gt;]</code></p>
  </blockquote>
  
  <p>How would I go about solving something like this so that it would actually return the gpa?</p>