Previous
Classes and Objects
5 / 5
Next
Capstone
Hint
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
Help
Solve
Reset
Test results
Test result #
Expected output
Your output