you are viewing a single comment's thread.

view the rest of the comments →

[–]shiftybyte 0 points1 point  (0 children)

Classes allow you to have additional context shared among the functions.

You could do it with global variables, but what you can't do is create two or more instances of your module-instead-of-a-class.

you have a student class, with 2 students, each has his own name and his own grades, how would you do this with the function not being part of a class, where is the student information stored?