Hello I am trying to build a class to clean a string, however I dont understand why I got the following output:
python3 clean.py
<bound method clean_string.split_func of <__main__.clean_string object at 0x7fb70486b0f0>>
My class looks as follows:
class clean_string:
def __init__(self,cadena):
self.replace_chars = {"á":"a","ó":"o"}
self.cadena = cadena
def split_func(self):
return self.cadena.split(' ')
test_string = clean_string('this is a test')
However when I execute the code I only got the memory reference object:
print(test_string.split_func)
<bound method clean_string.split_func of <__main__.clean_string object at 0x7fb70486b0f0>>
I want to get the following output:
['this', 'is', 'a', 'test']