classes and object-oriented programming consider the code mitperson('barbara beaver'print str( '\' id number is str( getidnum()the first line creates new mitperson the second line is bit more complicated when it attempts to evaluate the expression str( )the runtime system first checks to see if there is an __str__ method associated with class mitperson since there is notit next checks to see if there is an __str__ method associated with the superclasspersonof mitperson there isso it uses that when the runtime system attempts to evaluate the expression getidnum()it first checks to see if there is getidnum method associated with class mitperson there isso it invokes that method and prints barbara beaver' id number is (recall that in stringthe character "\is an escape character used to indicate that the next character should be treated in special way in the string '\' id number is the "\indicates that the apostrophe is part of the stringnot delimiter terminating the string now consider the code mitperson('mark guttag' mitperson('billy bob beaver' mitperson('billy bob beaver' person('billy bob beaver'we have created four virtual peoplethree of whom are named billy bob beaver two of the billy bobs are of type mitpersonand one merely person if we execute the lines of code print ' =' print ' =' print ' =' the interpreter will print true false true since and are all of type mitpersonthe interpreter will use the __lt__ method defined in class mitperson when evaluating the first two comparisonsso the ordering will be based on identification numbers in the third comparisonthe operator is applied to operands of different types since the first argument of the expression is used to determine which __lt__ method to invokep is shorthand for __lt__( thereforethe interpreter uses the __lt__ method associated with the type of personand the "peoplewill be ordered by name what happens if we try print ' ='