Question: 1- To define - operator for a new class, one needs to: a.define __ sub __() method b.It is impossible to define such an operator
1- To define "-" operator for a new class, one needs to:
a.define __sub__() method
b.It is impossible to define such an operator for user-defined classes.
2-Is it impossible to make static variable in a Python class.
True
False
3- defsubclass()can be used to define an objectin Python that inherits its attributes and methods from a parent class?
True
False
4- What is needed to make a new object in Python?
a.define__str__() method
b.define a constructor method
c.both constructor and __str__() methods
d.None of the above.
5- n Python you can derive a class from two parent classes but not from three parent classes.
True
False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
