Exemplo n.º 1
0
def main():
    myC1 = Circle(2)
    myR1 = Rectangle(2,3)
    print(myC1.getArea())
    print(myR1.getColor())
    myC1.setColor("green")
    print(myC1.getColor())
    print(myR1.getColor())
def main():
    circle = Circle(1.5)
    print("A circle", circle)
    print("The radius is", circle.getRadius())
    print("The area is", circle.getArea())
    print("The diameter is", circle.getDiameter())

    rectangle = Rectangle(2, 4)
    print("\nA rectangle", rectangle)
    print("The area is", rectangle.getArea())
    print("The perimeter is", rectangle.getPerimeter())
def main():
    circle = Circle(1.5)
    print("원", circle)
    print("반지름은", circle.getRadius(), "입니다.")
    print("넓이는", circle.getArea(), "입니다.")
    print("지름은", circle.getDiameter(), "입니다.")

    rectangle = Rectangle(2, 4)
    print("\n사각형", rectangle)
    print("넓이는", rectangle.getArea(), "입니다.")
    print("둘레", rectangle.getPerimeter(), "입니다.")
Exemplo n.º 4
0
def main():
    circle = Circle(1.5)
    print("A circle", circle)
    print("The radius is", circle.getRadius())
    print("The area is", circle.getArea())
    print("The diameter is", circle.getDiameter())

    rectangle = Rectangle(2, 4)
    print("A rectangle", rectangle)
    print("The area is", rectangle.getArea())
    print("The perimeter is", rectangle.getPerimeter())