My Python Code
My Views
I like Python and I am still learning python myself at home from Learn Python The Hard Way I belive that the Python course at University with Saeed was too short it should have been longer atleast to the end of the semester.My Code
def Middlesex_Banking_System():PIN = '1234'
print "Welcome to the Middlesex Banking System"
PIN = raw_input ("Enter PIN Number: ")
while (PIN != '1234'):
print ""
print 'Incorrect PIN Number, Please Try Again:'
PIN = raw_input ("Enter PIN Number: ")
print ""
print ""
print 'PIN Accepted, Please select an option from the menu below:'
print ""
Menu()
def Menu():
Cash = 1000
Overdraft = 500
Balance = Cash + Overdraft
print "1. Withdraw Cash"
print "2. Deposit Cash"
print "3. Account Balance"
print "4. Exit"
print ""
option = raw_input("Select a option from the menu: ")
if "1" in option:
amount = raw_input ("Enter how much money you want to withdraw: $")
amount = int(amount)
Balance -= amount
print "Your new balance is $" + str(Balance)
print ""
if amount >500 print "test"
Menu()
elif "2" in option:
amount = raw_input ("Enter how much money you want to deposit: $")
amount = int(amount)
Balance += amount
print "Your new balance is $" + str(Balance)
print ""
Menu()
elif "3" in option:
print ""
print "You currently have $", str(Balance), "available in your account"
print ""
Menu()
elif "4" in option:
print "Thank you for using the Middlesex Banking System, Have a nice day :)"
print ""
Middlesex_Banking_System()
else:
print ""
print "Invalid Option, Please Try Again: "
print ""
Menu()
Middlesex_Banking_System()
2 comments:
Thanks for sharing this, it's good to be able to compare it to my own.
Hey! I can finally compare my work with someone else's.
Post a Comment