Undefined Variable Name seems to be a common problem and I've followed the exact process as some of the examples on here, but I have not had any success.
From what I understand, you have to make a class if you have multiple functions, and then make an instance of the class to call these methods.
Here is my pseudo-code:
start = KMP()
start.read()
class KMP:
def read(self):
Text = "AGABBBACC"
Pattern = "BBB"
result = self.kmp(self, Pattern, Text)
def kmp(self, Pattern, Text):
........
........
return self.numOcc`
I'm getting a undefined name 'KMP', and I really don't understand why. Could anyone help me in solving this error?
start = KMP()