class Student:

    def __init__(self, name, hours, qpoints):
        self.name = name
        self.hours = float(hours)
        self.qpoints = float(qpoints)

    def get_name(self):
        return self.name

    def get_hours(self):
        return self.hours

    def get_qpoints(self):
        return self.qpoints

    def gpa(self):
        return self.qpoints / self.hours


def make_student(info_str):
    # info_str is a tab-separated line: name    hours   qpoints
    # returns a corresponding Student object
    name, hours, qpoints = info_str.split('\t')
    return Student(name, hours, qpoints)


def main():
    # open the input file for reading
    filename = input('Enter the name of the grade file: ')
    infile = open(filename, 'r')

    # set best to the record for the first student in the file
    best = make_student(infile.readline())

    # process subsequent lines of the file
    for line in infile:
        # turn the line into a student record
        s = make_student(line)
        # if this student is best so far, remember it.
        if s.gpa() > best.gpa():
            best = s

    infile.close()

    # print information about the best student
    print('The best student is', best.get_name())
    print('hours:', best.get_hours())
    print('GPA:', best.gpa())


if __name__ == '__main__': main()
class Student:

    def __init__(self, name, hours, qpoints):
        self.name = name
        self.hours = float(hours)
        self.qpoints = float(qpoints)

    def get_name(self):
        return self.name

    def get_hours(self):
        return self.hours

    def get_qpoints(self):
        return self.qpoints

    def gpa(self):
        return self.qpoints / self.hours


def make_student(info_str):
    # info_str is a tab-separated line: name    hours   qpoints
    # returns a corresponding Student object
    name, hours, qpoints = info_str.split('\t')
    return Student(name, hours, qpoints)


def main():
    # open the input file for reading
    filename = input('Enter the name of the grade file: ')
    infile = open(filename, 'r')

    # set best to the record for the first student in the file
    best = make_student(infile.readline())

    # process subsequent lines of the file
    for line in infile:
        # turn the line into a student record
        s = make_student(line)
        # if this student is best so far, remember it.
        if s.gpa() > best.gpa():
            best = s

    infile.close()

    # print information about the best student
    print('The best student is', best.get_name())
    print('hours:', best.get_hours())
    print('GPA:', best.gpa())


if __name__ == '__main__': main()
# info_str is a tab-separated line: name    hours   qpoints # returns a corresponding Student object # open the input file for reading # set best to the record for the first student in the file # process subsequent lines of the file # turn the line into a student record # if this student is best so far, remember it. # print information about the best student