Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- dict={}
- wrong = 0
- def clear():
- os.system("clear")
- return
- def remainingBal():
- print("\nYou remaining balence is: $" + str(total))
- return
- def mainScreen():
- clear()
- print(" Hello "+ name.capitalize()+"! Welcome back!")
- print("\n************************************************************")
- print("\n--------------|Your total checking is: $" + str(dict[name][2])+"|---------------")
- print("\nHow can I help you today?")
- print("\nType 1 for deposit.\n\nType 2 for withdrawl.\n\nType 3 to exit.")
- return
- while True:
- print(" |**************************************************|\n |********//\\\******============****| \*****/ |*****|\n |*******//**\\\**********||*********||\\\***//||*****|\n |******//****\\\*********||*********||*\\\*//*||*****|\n |*****//******\\\********||*********||**\!/**||*****|\n |*****||******||********||*********||*******||*****|\n |*****| ====== |********||*********||*******||*****|\n |*****||******||********||*********||*******||*****|\n |*****||******||********||*********||*******||*****|\n |*****||******||********||*********||*******||*****|\n |**************************************************|\n\n")
- acc = input("Are you an existing account holder or are you new? \nType 1 for new or 2 for existing.\n")
- if acc == "1":
- name = input("What is your name? ")
- passw = input("Create a password. ")
- passw2= input("Re-type your password. ")
- if passw == passw2:
- bal = input("\nHow much will you deposit in your new account? ")
- dict[name] = (name,passw,bal)
- else:
- clear()
- print("Password did not match.\nPlease try again.\n")
- continue
- elif acc == "2":
- name = input("What is your name? ")
- passw = input("What is your password? ")
- if name not in dict:
- clear()
- print("\nWrong user name. Try again.\n\n")
- continue
- else:
- clear()
- print("Please re-enter.\n")
- continue
- while True:
- if name == dict[name][0] and passw == dict[name][1]:
- dict[name][2]
- mainScreen()
- inpt = input()
- if inpt =="2":
- inpt2 = input("\nHow much would you like to withdrawl? $")
- total = int(dict[name][2]) - int(inpt2)
- dict2 ={name:(name,passw,total)}
- dict.update(dict2)
- remainingBal()
- mainScreen()
- elif inpt =="1":
- inpt3 = input("\nHow much would you like to deposit? $")
- total = int(dict[name][2]) + int(inpt3)
- dict2 = {name:(name,passw,total)}
- dict.update(dict2)
- remainingBal()
- mainScreen()
- elif inpt == "3":
- clear()
- break
- else:
- clear()
- wrong = wrong + 1
- if wrong <= 5:
- print("Wrong username or password")
- break
- else:
- print("Account locked!!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement