instantiate many classes python code example

Example 1: python instantiate class

# To instantiate a class, you need to have a __init__ function inside the class
# Example:
class Human(object):
  
    def __init__(self, name, age): # Here is that function I was talking about
        # It sets some variables so I can use them in other functions in this class.
        self.name = name
        self.age = age
    
    def say_name(self):
        print(f"My name is {self.name}.")
    
    def say_age(self):
        print(f"My age is {self.age}.")

bob = Human("Bob", 28)
bob.say_name()
bob.say_age()

Example 2: class python 3

A class is a block of code that holds various functions. Because they
are located inside a class they are named methods but mean the samne
thing. In addition variables that are stored inside a class are named 
attributes. The point of a class is to call the class later allowing you 
to access as many functions or (methods) as you would like with the same
class name. These methods are grouped together under one class name due
to them working in association with eachother in some way.

#example
# To create a simple class:
class Shape:
  	def __init__():
      	print("A new shape has been created!")
      	pass
    
    def get_area(self):
		pass

# To create a class that uses inheritance and polymorphism
# from another class:
class Rectangle(Shape):
  
	def __init__(self, height, width): # The constructor
    	super.__init__()
        self.height = height
    	self.width = width

	def get_area(self):
      	return self.height * self.width