Improve the constructor in Exer. 7.5. The constructor in class Line in Exercise 7.5 takes two points as arguments. Now we want to have more flexibility in the way we specify a straight line: we can...


Improve the constructor in Exer. 7.5. The constructor in class Line in Exercise 7.5 takes two points as arguments. Now we want to have more flexibility in the way we specify a straight line: we can give two points, a point and a slope, or a slope and the line’s interception with the y axis. Hint: Let the constructor take two arguments p1 and p2 as before, and test with isinstance whether the arguments are float or tuple/list to determine what kind of data the user supplies:


Exercise 7.5

Nov 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here