ok you will probably be sick of my posts but i have tryed and got this far, i ripped the program to pieces and started again. basically its a atm program that i have to do for college. if anyone can see why its not workin properly it would be a great help.
import pickle
f= open ("pin.pck", "w")
pickle.dump(1234, f)
pickle.dump([1,2,3,4], f)
f.close()
#Pin Validation
def pin():
f=open("pin.pck", "r")
x=pickle.load(f)
print
print " ***Welcome to the bellco banking system***"
print "============================================="
print "Please insert your card"
print ""
print "Card Accepted"
print ""
pin = input ("Please insert your pin number to the keypad: ")
print "=============================================="
#Checks if pin is within range of 1000 to 9999
while True:
if pin>=1000
print "Pin accepted"
if pin =<9999:
print "Pin accepted"
print
if pin== x:
print "Valid Pin"
print
if pin != x:
print "Invalid Pin"
print
pin()
break
else:
print "Invalid Pin"
pin()
break
#Create Menu
def createmenu():
print " ***Welcome to Bank ATM*** "
print "=================================="
print " Please select one of the below "
print " 1 Withdrawal only"
print " 2 Withdrawal With Statement"
print " 3 Statement only"
print " 4 Quit"
print "=================================="
#Statement Procedure
def statement():
print "Your balance is $" #balance details
print
print "Thank you for using this Bank ATM"
print "=================================="
#Withdrawal Procedure
def withdrawal():
print "================================"
print " Please select one of the below "
print " 1 $50"
print " 2 $100"
print " 3 $150"
print " 4 $200"
print "================================="
amount= raw_input ("Please make your selection:")
print "===================================="
while True:
if amount == "1":
print "You have chosen to withdraw $50"
print
print "Please take your cash"
print "================================="
break
#Insert coding to remove cash from balance
elif amount == "2":
print "You have chosen to withdraw $100"
print
print "Please take your cash"
print "==================================="
break
#Insert coding to remove cash from balance
elif amount == "3":
print "You have chosen to withdraw $150"
print
print "Please take your cash"
print "================================="
break
#Insert coding to remove cash from balance
elif amount == "4":
print "You have chosen to withdraw $200"
print
print "Please take your cash"
print "================================="
break
else:
print "Invalid Selection - Re-enter"
withdrawal()
break
#Menu Options
def selectoption():
keypadinput = raw_input ("Enter your selection: ")
while True:
if keypadinput == "1":
print
print "You have chosen to make a withdrawal"
withdrawal()
break
elif keypadinput == "2":
print
print "You have chosen to make a withdrawal withdrawal with a statement"
withdrawal()
statement()
break
elif keypadinput == "3":
print
print "You have chosen to print a statement"
statement()
break
elif keypadinput == "4":
print
print "Thank you for using this Bank ATM"
break
else:
print "Invalid Selection"
selectoption()
break
#Initiate Program
pin()
createmenu()
selectoption()