GeezerVison is showing github.com — Make explicit the rectangle coordinates · python043/full-speed-python@bc4d68e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: chapters/classes.md +2-2Lines changed: 2 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,9 +34,9 @@ Hello, my name is Anna! |
34 | 34 |
|
35 | 35 | Use the Python documentation on classes at <https://docs.python.org/3/tutorial/classes.html> to solve the following exercises. |
36 | 36 |
|
37 | | -1. Implement a class named "Rectangle" to store the coordinates of a rectangle given by (x1, y1) and (x2, y2). |
| 37 | +1. Implement a class named "Rectangle" to store the coordinates of a rectangle given the top-left corner (x1, y1) and the bottom-right corner (x2, y2). |
38 | 38 |
|
39 | | -2. Implement the class constructor with the parameters (x1, y1, x2, y2) and store them in the class instances using the "self" keyword. |
| 39 | +2. Implement the class constructor with the parameters (x1, y1, x2, y2) and store them in the class instance using the "self" keyword. |
40 | 40 |
|
41 | 41 | 3. Implement the "width()" and "height()" methods which return, respectively, the width and height of a rectangle. Create two objects, instances of "Rectangle" to test the calculations. |
42 | 42 |
|
|