Definition: A class is a collection of functions grouped together with the data these functions act upon (i.e. a collection of variables). In the context of classes, functions are no longer called function but methods, and variables are called attributes.
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
class student(object):
def __init__(self, name, major, GPA, UID):
self.Name = name
self.major = major
self.GPA = GPA
self.UID = UID
In [ ]:
Bob = student('Bob Duran', 'ECON', '3.4', '100003443')
In [ ]:
In [ ]:
In [ ]:
Bob.display()
In [ ]: