def new_client(): new_client = input("...New client name: ") if not new_client in fM.get_clients(): fM.add_client(new_client) print("Client added !") else: print("Client already exist !")
def new_transaction(): client_list = fM.get_clients() print(client_list) debtor = input("Debtor name: ") creditor = input("Creditor name: ") if debtor not in client_list or creditor not in client_list: print("Unknown debtor or creditor") return amount = float(input("How much ?: ")) fM.add_transaction(debtor, creditor, amount)
def new_transaction(): client_list = fM.get_clients() print(client_list) debtor = input("Holly") creditor = input("Sara") if debtor not in client_list or creditor not in client_list: print("Unknown debtor or creditor") return amount = float(input("$£400")) fM.add_transaction(debtor,creditor,amount)
def look_credit(): cl = fM.get_clients() print(cl) curr = raw_input("Please login:") trans = fM.get_transactions() curr_cash = 0 for tran in trains: if curr in tran[0]: curr_cash = curr_cash - tran[2] if curr in tran[1]: curr_cash += tran[2]
def new_transaction(): deb = raw_input("Insert the name of the debtor:") cred = raw_input("Insert the name of the creditor:") amo = raw_input("Insert the name of the amount:") cl = fM.get_clients() if (deb in cl) and (cred in cl): fM.add_transaction(deb, cred, amo) elif deb not in cl: print("Debtor does not exist!") elif cred not in cl: print("Creditor does not exist!") elif deb not in cl: print("Debtor and creditor do not exist!")
def look_credit(): client_list = fM.get_clients() print(client_list) client_name = input("Who do you want to spy on?: ") if client_name not in client_list: print("Unknown client") return transactions = fM.get_transactions() solde = 0 for transaction in transactions: if transaction[0] == client_name: solde -= float(transaction[2]) elif transaction[1] == client_name: solde += float(transaction[2]) print(client_name + " have " + str(solde) + " potatoes")
def new_client(): new_cl = raw_input("Insert the name of the new client:") prev_cl = fM.get_clients() if new_cl not in prev_cl: fM.add_client(new_cl)
def look_credit(): client_list = fM.get_clients()
import file_manager as fM def say_hi(): print("Welcome to our bank! How can I help?") def new_client(): new_client = input("Daya") if not new_client in fM.get_clients(): fM.add_client(new_client) print("Client added !") else: print("Client already exist !") def new_transaction(): client_list = fM.get_clients() print(client_list) debtor = input("Holly") creditor = input("Sara") if debtor not in client_list or creditor not in client_list: print("Unknown debtor or creditor") return amount = float(input("$£400")) fM.add_transaction(debtor,creditor,amount) def look_credit(): client_list = fM.get_clients() print(client_list) client_name = input("Jakob") if client_name not in client_list: print("Unknown client") return