human
I am working on the file "Section 1 - Core Python/Chapter 09 - Classes & OOPS/01_Classes_and_OOPS.ipynb".
The first task is:
Note, in the above example all three objects are pointing to same object ohm meaning all three objects are same. 
Now, we might have situations where we need to raise exception, if creation of more than one instance is attempted. We can achieve it by raising an exception as shown in below example.
Can you write Python program for it?
 ... Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.

class SingletonError(Exception):
    pass

class HeadMaster(object):
    
    def __new__(cls, name):
        it = cls.__dict__.get("__it__")
        if it is not None:
            raise SingletonError(f"Count not create new instance for value {name}")
            
        cls.__it__ = it = object.__new__(cls)
        it.__init__(name)
        return it
    
    def __init__(self, name):        
        self.name = name
    
    def print_name(self):
        print(self.name)
        

try:
    print("Creating Anshu Mam as Primary School headmistress.")
    anshu_mam = HeadMaster("Anshu Shrivastava")
    print("Creating Rahim Sir as Primary School headmaster.")
    rahim_sir = HeadMaster("Rahim Khan")
except Exception as e:
    print(e)