class PaymentGateway(ABC): @abstractmethod def process_payment(self, amount): pass
from abc import ABC, abstractmethod
class StripePaymentGateway(PaymentGateway): def process_payment(self, amount): print(f"Processing payment of ${amount} using Stripe.") python 3 deep dive part 4 oop high quality
def charge_battery(self): print("The battery is charging.") amount): pass from abc import ABC
account = BankAccount("1234567890", 1000) print(account.get_balance()) # Output: 1000 account.deposit(500) print(account.get_balance()) # Output: 1500 5) circle = Circle(3)
stripe_gateway = StripePaymentGateway() paypal_gateway = PayPalPaymentGateway()
rectangle = Rectangle(4, 5) circle = Circle(3)