GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • chapters
    • classes.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎chapters/classes.md‎

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 numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ Hello, my name is Anna!
3434

3535
Use the Python documentation on classes at <https://docs.python.org/3/tutorial/classes.html> to solve the following exercises.
3636

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).
3838

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.
4040

4141
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.
4242

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.