def generate_dummy_account(): firstname = "Rianna" lastname = "Johnson" account_type = "savings".lower() address = "13 Riddlesworth Road" year = 2020 username = "******" password = "******" account = Account(firstname, lastname, account_type, address, year, username, password) account.balance = 100 return account
def marshal_account(row): serial_number = row['Serial Number'] firstname = row['First Name'] lastname = row['Last Name'] address = row['Address'] year = int(row['Year']) balance = float(row['Balance']) username = row['Username'] password = row['Password'] if serial_number[0] == "C": account_type = "Current" elif serial_number[0] == "S": account_type = "Savings" account = Account(firstname, lastname, account_type, address, year, username, password) account.serial_number = serial_number account.balance = balance return account
y1 = Y(1) print diff(y1.value, 0, 1) from classes import Account a1 = Account('John Olsson', '19371554951', 20000) a2 = Account('Liz Olsson', '19371564761', 20000) a1.deposit(1000) a1.withdraw(4000) a2.withdraw(10500) a1.withdraw(3500) print "a1's balance:", a1.balance a1.dump() a2.dump() a1.no = '19371564764' a1.balance = 100 a1.dump() from classes import AccountP as Account a1 = Account('John Olsson', '19371554951', 20000) a1.deposit(1000) a1.withdraw(4000) a1.withdraw(3500) a1.dump() print a1._balance # it works, but a convention is broken print a1.get_balance() # correct way of viewing the balance a1._no = '19371554955' # this is a "serious crime" from classes import Person p1 = Person('Hans Petter Langtangen', office_phone='67828283',
print diff(y1.value, 0, 1) from classes import Account a1 = Account('John Olsson', '19371554951', 20000) a2 = Account('Liz Olsson', '19371564761', 20000) a1.deposit(1000) a1.withdraw(4000) a2.withdraw(10500) a1.withdraw(3500) print "a1's balance:", a1.balance a1.dump() a2.dump() a1.no = '19371564764' a1.balance = 100 a1.dump() from classes import AccountP as Account a1 = Account('John Olsson', '19371554951', 20000) a1.deposit(1000) a1.withdraw(4000) a1.withdraw(3500) a1.dump() print a1._balance # it works, but a convention is broken print a1.get_balance() # correct way of viewing the balance a1._no = '19371554955' # this is a "serious crime" from classes import Person p1 = Person('Hans Petter Langtangen',