What is true about Object-Oriented Programming in Python? (Select two answers)A . encapsulation allows you to protect some data from uncontrolled accessB . the arrows on a class diagram are always directed from a superclass towards its subclassC . inheritance is the relation between a superclass and a subclassD . an object is a...
What is the expected out of the code?
The following class hierarchy is given . What is the expected out of the code? A . BBB . CCC . AAD . BC View Answer Answer: D...
What is a true about python class constructors? (Select two answers)
What is a true about python class constructors? (Select two answers)A . the constructor must have at least one parameterB . the constructor must return a value other than NoneC . the constructor is a method named_init_D . there can the more than one constructor in a Python class. View Answer Answer: A,C...
What is the expected behavior of the following code?
What is the expected behavior of the following code? A . it outputs B . the code is erroneous and it will not executeC . it outputs D . it outputs View Answer Answer: A...
What is the expected output of the following code?
What is the expected output of the following code? A . abcefB . The program will cause a runtime exception errorC . acdefD . abdef View Answer Answer: B...
Which of the following expression evaluate to True? (Select two answers)
Which of the following expression evaluate to True? (Select two answers) A) B) C) D) A . Option AB . Option BC . Option CD . Option D View Answer Answer: C,D...
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)A . dir={‘Mom’:5551234567, ‘Dad’:5557654321>B . dir={‘Mom’:’5551234567′, * Dad’:’5557654321′}C . dir={Mom:5551234567, Dad:5557654321}D . dir={Mom:’5551234567′, Dad:’5557654321′} View Answer Answer: C,D...
What is the expected behavior of the following code?
What is the expected behavior of the following code? A . it outputs 1B . it outputs 0C . it raises an exceptionD . it outputs 2 View Answer Answer: A...
What is the expected behavior of the following code?
What is the expected behavior of the following code? A . it raises an exceptionB . it outputs TrueC . it outputs FalseD . it outputs nothing View Answer Answer: B...
What is true about Python packages? (Select two answers)
What is true about Python packages? (Select two answers)A . the__name__variable content determines the way in which the module was runB . a package can be stored as a tree of sub-directories/sub-foldersC . __pycache__is the name of a built-in variableD . hashbang is the name of a built-in Python function View Answer Answer: B,C...