This is what I have learnt about python at Middlesex University.
def
ATM():
pin = '5555'
balance = 2000
overdraft = 200
while True:
pin_input = raw_input('insert your PIN
number: ')
if pin == pin_input:
print 'select from the following
options:'
print
break
else:
print 'wrong pin, try again'
print
while True:
menu_input = raw_input('\n1. Balance
\n2. Withdraw \n3. Deposit \n4. Exit \nchoose from menu: ')
if menu_input == '1':
print '\nAvailable withdraw: ' + str(balance + overdraft)
print '\nYour overdraft limit is: '
+ str(overdraft)
elif menu_input == '2':
Withdraw_input = raw_input('insert
the amount you would like to take out: ')
if (int(Withdraw_input) >
balance + overdraft):
print 'you are beyond your
balance limit'
else:
print 'withdrawn: ' +
str(Withdraw_input)
if (int(Withdraw_input) >
balance):
overdraft == overdraft_2
overdraft_2 = overdraft -
(int(Withdraw_input) - balance)
balance = (balance +
overdraft)- int(Withdraw_input)
elif menu_input == '3':
Deposit_input = raw_input('enter
the deposit: ')
print 'The deposited is: ' +
str(Deposit_input)
balance = balance +
int(Deposit_input)
elif menu_input == '4':
print '\n Thank You for using our service'
break
ATM
()
Do you think is that useful for you? Please leave your comments
It works perfectly
ReplyDeletepython was confusing! LOL but got the hang of it
ReplyDeleteYeah it was.
Deleteoh? is this the code that who've used for your python assignment???
ReplyDeleteyeah,...
Deletelooks good mate hope you got a good result!
ReplyDeleteI got very good score for that.
Deletedo you think you could help me out with this
ReplyDeletefor sure yes.
DeletePyton is really good if you do programming.
ReplyDeletePython is sometimes a bit boring to do
ReplyDelete