Professional Documents
Culture Documents
Protected members of a class are accessible from within the class and are also available to its sub-
classes. T
All classes have a function called __init__(), which is always executed when the class is being initiated. T
Public members of a class are accessible from within the class and are also available to its sub-classes. T
You can not use the else keyword to define a block of code to be executed if no errors were raised. F (DI
KASAMA DAPAT YUNG "NOT")
Instance attributes and methods defined in the child class will be inherited by the object of the parent
class. F BALIKTAD
Methods of the parent class are available for use in the inherited class. T
20/20
A double underscore __ prefixed to a variable makes it privat.It gives a strong suggestion not to touch it
from outside the class. Any attempt to do so will result in an AttributeError. T
Python's convention to make an instance variable protected is to add a prefix __ (double underscore) to
it. F SINGLE UNDER
Python prescribes a convention of prefixing the name of the variable/method with single or double
underscore to emulate the behaviour of protected and private access specifiers. T
Use the __init__() function to assign values to object properties, or other operations that are necessary
to do when the object is being created. T
Public members (generally methods declared in a class) are accessible from outside the class.T
The rectangle() method is overridden to implement the formula for the area of the square as the square
of its sides F
Instance attributes and methods defined in the child class will be inherited by the object of the parent
class. F
You can use the else keyword to define a block of code to be executed if no errors were raised. T
The name of the parent class is put in the parentheses in front of it, indicating the relation between the
two. T
The constructor (the __init__() method) receives four parameters and assigns them to six instance
variables. F FOUR INTANCE LANG
To throw (or raise) an exception, use the delete keyword. F RAISE KEY
The area() method is overridden to implement the formula for the area of the square as the square of its
sides. T
The constructor (the __init__() method) receives four parameters and assigns them to four instance
variables. T