So I've been watching a video tutorial on classes in Python, and the code looks like this:
def _init_(self, msg):
self.msg = msg
inst = MyPythonClass('hello')
That's copied pretty much verbatim, and the code works in the video. But when using it as above in Eclipse workspace, i get the following error:
TypeError: object() takes no parameters
And, when using it with the class method
print_msg('hello') instead, I get the following error:
TypeError: say_hello() takes 1 positional argument but 2 were given
I only passed 1 string argument, not 2 arguments, right..
Btw, the tutorial I think uses around Python 3.1, while I'm using Python 3.6.
Why do I get these errors?