Esempio n. 1
0
def cancelAccount():
    cancelName = input('請輸入解約人:')
    cancelAccount == None:
    for act in list.keys():
        if key in act.keys():
            if key == cancelName:
                cancelAccount = act.get
Esempio n. 2
0
def wirthdraw():
    actName = input("請輸入提款人")
    x = int(input("請輸入提款金額"))
    #得到提款人的 account 物件
    account = None
    for act in list:
        for key in act.keys():
            if key == actName:
                account = act.get(key)
    if account == None:
        print("查無此人")
    else:
        account.withdraw(x)
Esempio n. 3
0
def save():
    actName = input("請輸入存款人")
    x = int(input("請輸入存款金額"))
    #得到存款人的 account 物件
    account = None
    for act in list:
        for key in act.keys():
            if key == actName:
                account = act.get(key)
    if account == None:
        print("查無此人")
    else:
        account.save(x)
Esempio n. 4
0
def withdraw():
    actName = input('請輸入提款人: ')
    money = int(input('請輸入提款金額: '))
    # 得到存款人的account物件
    account = None
    for act in list:
        for key in act.keys():
            if key == actName:
                account = act.get(key)
    if account == None:
        print('查無此人')
    else:
        account.withdraw(money)
Esempio n. 5
0
def transfer():
    fromName = input("請輸入轉帳人(from): ")
    toName = input("請輸入被轉帳人(to): ")
    x = int(input("請輸入轉帳金額"))
    fromAccount = None
    toAccount = None
    for act in list:
        for key in act.keys():
            if key == fromName:
                fromAccount = act.get(key)
            if key == toName:
                toAccount = act.get(key)
    if fromAccount == None or toAccount == None:
        print("查無此人")
    else:
        fromAccount.transfer(x, toAccount)
Esempio n. 6
0
def display():
    for act in list:
        for key in act.keys():
            print(key, act.get(key))