July project night/OO lesson/mainProgram3.py

From OpenHatch wiki
Jump to navigation Jump to search

import banking3 as banking

theBank = banking.Bank() userAnna = theBank.addUser("Anna","myPassword") print userAnna.username

isLoggedIn = theBank.logIn(userAnna.username, userAnna.password) if isLoggedIn:

   accountAnna = theBank.addAccount(userAnna)
   accountAnna.addMoney(10)
   

isLoggedIn = theBank.logIn(userAnna.username, "bad password") if isLoggedIn:

   accountAnna.withdrawMoney(accountAnna.balance)

else:

   print "Bad user! No moneys for you."