Recent Posts
Archives

PostHeaderIcon [AWSReInventPartnerSessions2024] Simulate COBOL data handling in Java-like structure

class Account:
def init(self, balance):
self.balance = balance

def transaction(self, amount):
    if amount > 0:
        self.balance += amount
    else:
        if abs(amount) <= self.balance:
            self.balance += amount
        else:
            raise ValueError("Insufficient funds")

Leave a Reply