Classes and Objects
4 / 4
Multiple classes
Create a class Line
with:
- Constructor taking slope
a
and interceptb
. - Method
__str__
returning "y = {a}*x + {b}" - Method
contains
with parameterp
returning True if pointp
lies on the line - Method
intersect
with parameterl
returning the point on which the line intersects withLine l