<jupyter_start><jupyter_text>Assignment_5  Q1. What is the meaning of multiple inheritance? When a class is derived from more than one base class it is called multiple Inheritance. The derived class inherits all the features of the base case.  Q2. What is the concept of delegation? Delegation is an object oriented technique (also called a design pattern). Let's say you have an object x and want to change the behaviour of just one of its methods. You can create a new class that provides a new implementation of the method you're interested in changing and delegates all other methods to the corresponding method of x. The delegation is accomplished via the __getattr__ method; consult the language reference for more information about controlling attribute access.  Q3. What is the concept of composition? It is one of the fundamental concepts of Object-Oriented Programming. A class that references to one or more objects of other classes as an Instance variable. Here, by using the class name or by creating the object we can access the members of one class inside another class. It enables creating complex types by combining objects of different classes. It means that a class Composite can contain an object of another class Component. This type of relationship is known as Has-A Relation.  Q4. What are bound methods and how do we use them? A bound method is the one which is dependent on the instance of the class as the first argument. It passes the instance as the first argument which is used to access the variables and functions. All functions in the class are by default bound methods.<jupyter_code>class Sample:
    def fun(self, some_value):
        self.some_value = some_value
    
s = Sample()

print(s.fun)<jupyter_output><bound method Sample.fun of <__main__.Sample object at 0x0000024D6EEA5AC0>><jupyter_text>Q5. What is the purpose of pseudoprivate attributes? In Python, there is no concept of "private" as such. When naming properties and methods at the level, some special processing is actually done to the name, making it inaccessible to the outside world.<jupyter_code>class Test:
    def __init__(self, a, b, c, d):
        self.__a = a # __ means pseudo private variable
        self.b = b
        self.c = c
        self.d = d

    def custom(self, v):
        return v - self.__a

t = Test(1,2,3,4)    
print(t._Test__a) # this is the way to access Pseudo private  attribute
print(t.b)
print(t.custom(5))<jupyter_output>1
2
4
{'fraction_non_alphanumeric': 0.04632263307598537, 'fraction_numerical': 0.010158472165786265, 'mean_word_length': 4.024489795918368, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '431433', 'license': 'MIT', 'n_tokens_mistral': 641, 'n_tokens_neox': 621, 'n_words': 365, 'path': 'assignments/PythonAdvanceTheory/Python_Advance_5.ipynb', 'repo_name': 'sanneabhilash/ineuron_datasciencemasters', 'size': '2461'}