Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True?
(Choose two.)
Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True?
(Choose two.)
ClassA.__module__ == '__main__' evaluates to True because the code is assumed to be run in the main module context. __name__ == '__main__' also evaluates to True for the same reason. The other options are incorrect: str(Object) == 'Object' is False because Object is an instance of ClassA, which does not override the __str__ method, so it uses the default string representation of the object. len(ClassB.__bases__) == 2 is also False because ClassB has only one direct base class, which is ClassA.
True: A. ClassA.__module__ == '__main__' B. __name__ == '__main__'
A and B are True
A & B are true
class ClassA: var = 1 def __init__(self, prop): prop1 = prop2 = prop class ClassB(ClassA): def __init__(self, prop): prop3 = prop ** 2 super().__init__(prop) def __str__(self): return 'Object' Object = ClassA(2) A and B are True
There are at least 45 completely wrong questions in this dump!!!!! be careful
class ClassA: var = 1 def __init__(self, prop): prop1 = prop2 = prop class ClassB(ClassA): def __init__(self, prop): prop3 = prop ** 2 super().__init__(prop) def __str__(self): return 'Object' Object = ClassA(2) print(ClassA.__module__ == '__main__') print(__name__ == '__main__') #print(str(Object) == 'Object')#TypeError: '_io.TextIOWrapper' object is not callable print(len(ClassB.__bases__) == 2) Ans is A,B
AB tested