I have this little test code to see how classes work.
class Person:
def __init__(self):
self.name = ("Mike")
def myfunc(self):
print("Hello my name is " + self.name)
p1 = Person()
hello = p1.myfunc()
hello
What I want is for self.name to be returned from the class so I can use it outside of the class. Is this possible? I want the value to be returned without the 'hello my name is' string, so when printing the value returned the output is 'Mike' not 'Hello my name is Mike'. For now, it's just one value as this is a test code. If it works perfectly here, I will put it on my real code to make sure it works.