Exemple #1
0
def edit_account_type_name(account):
    old_name = account.account_type
    new_name = input(
        'What would you like to rename this account? ').strip().upper()
    if new_name.isalpha():
        account.account_type = new_name
        update_account_info(account, 'account_type', new_name)
        print(f'{old_name} has been updated to {new_name}')
    else:
        print(
            'Account type name cannot contain numbers, please re-enter using only letters'
        )
Exemple #2
0
def edit_monthly_fees(account):
    old_fee = account.monthly_fees
    new_fee = input('What is the monthly fee for this account type? $').strip()
    try:
        new_fee = float(new_fee)
        account.monthly_fees = new_fee
        update_account_info(account, 'monthly_fees', new_fee)
        print(
            f'Old monthly fee of ${old_fee:,.2f} has been updated to ${new_fee:,.2f}'
        )
    except ValueError:
        print('Please try again with a number')
        edit_interest_rate(account)
Exemple #3
0
def edit_minimum_balance(account):
    old_balance = account.minimum_balance
    new_balance = input(
        'What is the minimum balance for this account type? $').strip()
    try:
        new_balance = float(new_balance)
        account.minimum_balance = new_balance
        update_account_info(account, 'minimum_balance', new_balance)
        print(
            f'Old minimum balance of ${old_balance:,.2f} has been updated to ${new_balance:,.2f}'
        )
    except ValueError:
        print('Please try again with a number')
        edit_minimum_balance(account)
Exemple #4
0
def edit_interest_rate(account):
    old_rate = account.interest_rate
    new_rate = input(
        'What is the new interest rate for this account type? ').strip()
    try:
        new_rate = float(new_rate)
        account.interest_rate = new_rate
        update_account_info(account, 'interest_rate', new_rate)
        print(
            f'Old rate of {old_rate:,.2f}% has been updated to {new_rate:,.2f}%'
        )
    except ValueError:
        print('Please try again with a number')
        edit_interest_rate(account)
Exemple #5
0
def edit_max_withdrawals(account):
    old_number = account.max_withdrawals
    new_number = input(
        'What is the maximum number of withdrawals allowed for this account type? '
    ).strip()
    try:
        new_number = int(new_number)
        account.max_withdrawals = new_number
        update_account_info(account, 'max_withdrawals', new_number)
        print(
            f'Old maximum number of withdrawals of ${old_number} has been updated to ${new_number}'
        )
    except ValueError:
        print('Please try again with a whole number')
        edit_max_withdrawals(account)