[Tutor] class newbie

Michael C mysecretrobotfactory at gmail.com
Sun Jul 23 16:24:49 EDT 2017


class mahschool:
    def print():
        print('Say something')


a = mahschool()

a.print()



With this, I get this error:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    a.print()
TypeError: print() takes 0 positional arguments but 1 was given


What did I do wrong?

Thanks!


More information about the Tutor mailing list