<gh_stars>0
#!/usr/bin/env python3
"""Bank account without synchronization cause race condition """


class UnsyncedBankAccount:
    """Bank account without synchronization"""

    balance: float

    def __init__(self, balance: float = 0):
        self.balance: float = balance

    def deposit(self, amount: float) -> None:
        if amount > 0:
            self.balance += amount
        else:
            raise ValueError("You can't deposit negative amount of money")

    def withdraw(self, amount: float) -> None:
        if 0 < amount <= self.balance:
            self.balance -= amount
        else:
            raise ValueError("Account does not contain sufficient funds")

#!/usr/bin/env python3
"""Bank account without synchronization cause race condition """


class UnsyncedBankAccount:
    """Bank account without synchronization"""

    balance: float

    def __init__(self, balance: float = 0):
        self.balance: float = balance

    def deposit(self, amount: float) -> None:
        if amount > 0:
            self.balance += amount
        else:
            raise ValueError("You can't deposit negative amount of money")

    def withdraw(self, amount: float) -> None:
        if 0 < amount <= self.balance:
            self.balance -= amount
        else:
            raise ValueError("Account does not contain sufficient funds")
#!/usr/bin/env python3 Bank account without synchronization cause race condition Bank account without synchronization