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")
print
print " ***Welcome to the bellco banking system***"
print "============================================="
print ""
print "Card Accepted"
print ""
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

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 "================================="

print "===================================="
while True:
if amount == "1":
print "You have chosen to withdraw \$50"
print
print "================================="
break
#Insert coding to remove cash from balance
elif amount == "2":
print "You have chosen to withdraw \$100"
print
print "==================================="
break
#Insert coding to remove cash from balance
elif amount == "3":
print "You have chosen to withdraw \$150"
print
print "================================="
break
#Insert coding to remove cash from balance
elif amount == "4":
print "You have chosen to withdraw \$200"
print
print "================================="
break
else:
print "Invalid Selection - Re-enter"
withdrawal()
break
def selectoption():
while True:
print
print "You have chosen to make a withdrawal"
withdrawal()
break
print
print "You have chosen to make a withdrawal withdrawal with a statement"
withdrawal()
statement()
break
print
print "You have chosen to print a statement"
statement()
break
print
print "Thank you for using this Bank ATM"
break
else:
print "Invalid Selection"
selectoption()
break
#Initiate Program
pin()
selectoption()

## All 5 Replies

Please put your code in [ code ] and [ /code ] tag

Note:
Leave no space between square brackets('').

kath.

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")
print
print " ***Welcome to the bellco banking system***"
print "============================================="
print ""
print "Card Accepted"
print ""
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

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 "================================="

print "===================================="
while True:
if amount == "1":
print "You have chosen to withdraw \$50"
print
print "================================="
break
#Insert coding to remove cash from balance
elif amount == "2":
print "You have chosen to withdraw \$100"
print
print "==================================="
break
#Insert coding to remove cash from balance
elif amount == "3":
print "You have chosen to withdraw \$150"
print
print "================================="
break
#Insert coding to remove cash from balance
elif amount == "4":
print "You have chosen to withdraw \$200"
print
print "================================="
break
else:
print "Invalid Selection - Re-enter"
withdrawal()
break
def selectoption():
while True:
print
print "You have chosen to make a withdrawal"
withdrawal()
break
print
print "You have chosen to make a withdrawal withdrawal with a statement"
withdrawal()
statement()
break
print
print "You have chosen to print a statement"
statement()
break
print
print "Thank you for using this Bank ATM"
break
else:
print "Invalid Selection"
selectoption()
break
#Initiate Program
pin()
selectoption()``````

it is hard get replies if you send your code like this because your code is all mixed up and NOT properly indented. Hence it is hard to make out what code block comes within a function or while loop.
As you know python depends on indentation, to tell which to execute when it encounters conditional statements or loop control statements or function. So it is very important for you to make code properly indented and post. Even you cannot execute this program if you copy and paste and then execute. do you understand?

for eg:

``````if 1:
print "hi, how are you"
else:
print "bye."``````

can you see the difference now?

kath.

``````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")
print
print " ***Welcome to the bellco banking system***"
print "============================================="
print ""
print "Card Accepted"
print ""
print "=============================================="

#Checks if pin is within range of 1000 to 9999
while True:[indent]if pin>=1000[indent]print "Pin accepted"[/indent]
[indent][/indent]if pin =<9999:[indent]print "Pin accepted"[/indent]
[indent][/indent]print
if pin== x:[indent]print "Valid Pin"[/indent]
[indent][/indent]print
if pin != x:[indent]print "Invalid Pin"[/indent]
[indent][/indent]print
[/indent]pin()
break[indent]else:[/indent]
[indent]print "Invalid Pin"[/indent]
[indent][/indent]pin()
break

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 "================================="

print "===================================="
while True:[indent]if amount == "1":[indent]print "You have chosen to withdraw \$50"[/indent]
[indent][/indent][/indent]print
print "================================="
break
#Insert coding to remove cash from balance
[INDENT]elif amount == "2":
[INDENT]print "You have chosen to withdraw \$100"
[/INDENT]print
print "==================================="
break
#Insert coding to remove cash from balance
[INDENT]elif amount == "3":
[INDENT]print "You have chosen to withdraw \$150"
[/INDENT][/INDENT]print
print "================================="
break
#Insert coding to remove cash from balance
[INDENT]elif amount == "4":
[INDENT]print "You have chosen to withdraw \$200"
[/INDENT][/INDENT]print
print "================================="
break
[INDENT]else:
[INDENT]print "Invalid Selection - Re-enter"
[/INDENT][/INDENT]withdrawal()
break
def selectoption():
while True:
print
[INDENT]print "You have chosen to make a withdrawal"
[/INDENT][/INDENT]withdrawal()
break
[/INDENT]print
[INDENT][INDENT]print "You have chosen to make a withdrawal withdrawal with a statement"
[/INDENT][/INDENT]withdrawal()
statement()
break
[/INDENT]print
[INDENT]print "You have chosen to print a statement"
[/INDENT]statement()
break
[/INDENT]print
[INDENT][INDENT]print "Thank you for using this Bank ATM"
[/INDENT][/INDENT]break
[INDENT]else:
[INDENT]print "Invalid Selection"
[/INDENT][/INDENT]selectoption()
break
#Initiate Program
pin()