About 2,210,000 results
Open links in new tab
  1. Object Oriented Python - rectangle using classes and functions

    The purpose of this lab is to give you practice creating your own object. You will be given a main function that expects an instance of the (yet undefined) Rectangle object. Your job is to …

  2. How to write a Python rectangle class? - Stack Overflow

    Create a class named Rectangle with the following attributes and methods (sample run for each method included): Each instance should have an x, y, width, and height attributes. You should …

  3. python - Creating a Rectangle class - Stack Overflow

    Dec 5, 2014 · Rectangle class should have the following private data attributes: The Rectangle class should have an __init__ method that creates these attributes and initializes them to 1. It …

  4. Python: A class constructed by a length and width and a method …

    Apr 21, 2025 · Write a Python class named Rectangle with attributes for length and width and a method to compute and return its area. Write a Python class to calculate the perimeter and …

  5. Python Create New Class Rectangle - EasyCodeBook.com

    May 12, 2020 · Python Create New Class Rectangle: Create a class Rectangle with 2 instance variables length and width, find area and perimeter of rectangle objects.

  6. Create a Rectangle class (OOP) - by Ardit Sulce - Substack

    May 16, 2024 · Your current task is to create a Python class that represents a rectangle geometrical figure. The Rectangle class should: Two instance attributes, width, and height. An …

  7. object oriented programming in Python - My Courses

    Feb 28, 2020 · Write a Rectangle class in Python language, allowing you to build a rectangle with length and width attributes. Create a Perimeter() method to calculate the perimeter of the …

  8. 6.3: Rectangles - Engineering LibreTexts

    The docstring lists the attributes: width and height are numbers; corner is a Point object that specifies the lower-left corner. To represent a rectangle, you have to instantiate a Rectangle …

  9. python 3.x - Creating a rectangle class that accepts parameters

    Apr 19, 2019 · I am trying to create a create a rectangle class that accepts length and width as parameters. I would like the user to be able to enter a number and have python calculate the …

  10. ClassesPython 101 0.1.0 documentation - Read the Docs

    First an object of the class Rectangle is instantiated with the length argument set to 2 and the width argument set to 3. The name of our first Rectangle object is first_rectangle. …

  11. Some results have been removed
Refresh