I see that this question has been asked before, but believe me when I say that it is very frustrating trying to understand this concept and not being able to move on because of it. I really appreciate anyone helping out, so please let me know if I am not being clear with certain things.
I have been trying my best to move on and start coding in Python, as I am confident I understand the structure of the language when it comes to using flow control and trying to manipulate data types, however, I still do not seem to get a the grasp of OOP.
I have been doing quite a lot of research trying to understand what the difference between an Object and an Instance is and how those are invoked in a program those two terms is. As far as I know, they are the exact same thing, however, I get really confused when people start using really advanced terms to describe the concept. I understand that instantiating an Object is an Instance of a class, but what I do not understand is the precedence of one another.
For example:
class MyClass:
#Attributes?
def __init__(self, name, age):
self.name = name
self.age = age
def happy_birthday(self):
return 'You are {}, happy birthday {}.format(self.age, self.name)'
#someone said that the object is the instance, however, I do not understand that part.
#Instantiating an object?
boy1 = MyClass()
#Is this also an object or an instance if I call the function?
boy1.happy_birthday()
I have also been searching for examples that mark which parts are which in the code.