• Objects

    An object in programming is like a container that holds things. It can be used to store information like a box can store toys. For example, we could create an object called "cat" and it could have different pieces of information inside it like the cat's name, its color, or even how many lives it has left. Objects help us keep track of all the pieces of information we need for a program.

      • Map, Dictionary, Variable Objects

      • Python

        Example of object in python.
        person = {
        	'name': 'John',
        	'age': 36
        }
        
        print(person['name'])  # John
        print(person['age'])  # 36
        
      • Class Objects

      • Python

        Example of class object in python.
        class Person:
        	def __init__(self, name, age):
        		self.name = name
        		self.age = age
        
        	def greet(self):
        		print('Hello my name is ' + self.name)
        
        
        human = Person('John', 36)
        
        print(human.name)  # John
        print(human.age)  # 36
        human.greet()  # Hello my name is John