Serveur en cours migration - web.archireport.com temporairement indisponible
open chat

def area(self): return self.width * self.height

print(rectangle.area()) # Output: 20 print(circle.area()) # Output: 28.26

class PayPalPaymentGateway(PaymentGateway): def process_payment(self, amount): print(f"Processing payment of ${amount} using PayPal.")

class StripePaymentGateway(PaymentGateway): def process_payment(self, amount): print(f"Processing payment of ${amount} using Stripe.")

from abc import ABC, abstractmethod

class Circle(Shape): def __init__(self, radius): self.radius = radius

rectangle = Rectangle(4, 5) circle = Circle(3)

Encapsulation is the concept of hiding the internal implementation details of an object from the outside world. This is achieved by using access modifiers such as public, private, and protected.

Loading Archireport web
Close

Create an account

A genuinely free 30-day trial. No credit card required!

By subscribing, I agree with Archireport's terms and conditions
Create an account

Thank you !

You’ll receive an email to validate your account. Then you can use one of our 3 platforms and start using Archireport.

On iPad, On iPhone

The ultimate building site management app.

Archireport AppStore

Online

The desktop version, really convenient for creating and preparing projects.

Archireport icon

Download Archireport

You need the app in order to use all the Archireport features

Go dl
Archireport AppStore
FB Pixel