Question: Python Question A1a: Extending Geometric Shapes (1 points) Complete the method length in the class Line that returns the length of the line. Hint: You

Python Question A1a: Extending Geometric Shapes (1 points)

Complete the method length in the class Line that returns the length of the line.

Hint: You can use the Distance Formula to find the length of a line

Python Question A1a: Extending Geometric Shapes (1 points) Complete the method length

Question A1a: Extending Geometric Shapes (1 points) Complete the method length in the class Line that returns the length of the line Hint: You can use the Distance Formula to find the length of a line class Shape: setorigin(self, x, y): self.x, self.y = x, y def def move(self, dx, dy): ""Move by dx and dy"" " self.x, self.y= self.x + dx, self.y + dy class Line (Shape) def _init (self, x, y, u, v) ""Line with start point (x, y) and end point (u, v)""" Shape.setOrigin(self, x, y) def move (self, dx, dy): Shape.move (self, dx, dy) self.u, self.v self.u + dx, self.v + dy def length(self) pass # Replace this Line with your answer def str (self): return "Line from (str (self.x) + ", " + str(self.y) ") to (" str(self.u)", "str(self.v) + ")" 1 Line(e, e, 3, 4) print (1) assert 1. length() 5.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!