I want to add method1 to my class from outside of my class. Also I want to call method1 from inside of my class in order to changing the 'homework' to 0
def method1(self): print("Processing.....") print("Done :D") self.homework = 0 class S: homework = 10 def homeworkremover(self): S.method1 = method1 S.method1() a = S() print(a.homeworkremover()) But I've received an error code:
TypeError: method1() missing 1 required positional argument: 'self' Can you help me out pls?