Python

-->
def menu():
    pin = '5050'
    balance = 200
    overdraft = 50
    while True:
        pin_input = raw_input('Isert PIN : ')
        if pin == pin_input:
            print
            print 'Please select from the following options:'
            print
            break
        else:
            print
            print 'Incorrect pin, Please try again'
            print
           
    while True:
        menu_input = raw_input('\n1. Balance \n2. Withdraw \n3. Deposit \n4. Exit \nSelect from menu: ')
        if menu_input == '1':
            print '\nWithdraw: ' + str(balance + overdraft)
            print '\noverdraft : ' + str(overdraft)
           
        elif menu_input == '2':
            Withdraw_input = raw_input('Please enter the amount you would like to take out: ')
            if (int(Withdraw_input) > balance + overdraft):
                print 'Unable to withdraw'
               
            else:
                print 'You have withdrawn: ' + str(Withdraw_input)
                if (int(Withdraw_input) > balance):
                    overdraft_2 = overdraft - (int(Withdraw_input) - balance)
                balance = (balance + overdraft)- int(Withdraw_input)
                          
  
        elif menu_input == '3':
            Deposit_input = raw_input('Please enter the amount you would like to deposit: ')
            print 'The ammount you have deposited is: ' + str(Deposit_input)
            balance = balance + int(Deposit_input)
           
        elif menu_input == '4':
            print '\n Thank def menu():
    pin = '5050'
    balance = 200
    overdraft = 50
    while True:
        pin_input = raw_input('Isert PIN : ')
        if pin == pin_input:
            print
            print 'Please select from the following options:'
            print
            break
        else:
            print
            print 'Incorrect pin, Please try again'
            print
           
    while True:
        menu_input = raw_input('\n1. Balance \n2. Withdraw \n3. Deposit \n4. Exit \nSelect from menu: ')
        if menu_input == '1':
            print '\nWithdraw: ' + str(balance + overdraft)
            print '\noverdraft : ' + str(overdraft)
           
        elif menu_input == '2':
            Withdraw_input = raw_input('Please enter the amount you would like to take out: ')
            if (int(Withdraw_input) > balance + overdraft):
                print 'Unable to withdraw'
                
            else:
                print 'You have withdrawn: ' + str(Withdraw_input)
                if (int(Withdraw_input) > balance):
                    overdraft_2 = overdraft - (int(Withdraw_input) - balance)
                balance = (balance + overdraft)- int(Withdraw_input)
                          
  
        elif menu_input == '3':
            Deposit_input = raw_input('Please enter the amount you would like to deposit: ')
            print 'The ammount you have deposited is: ' + str(Deposit_input)
            balance = balance + int(Deposit_input)
           
        elif menu_input == '4':
            print '\n Thank def menu():
    pin = '5050'
    balance = 200
    overdraft = 50
    while True:
        pin_input = raw_input('Isert PIN : ')
        if pin == pin_input:
            print
            print 'Please select from the following options:'
            print
            break
        else:
            print
            print 'Incorrect pin, Please try again'
            print
           
    while True:
        menu_input = raw_input('\n1. Balance \n2. Withdraw \n3. Deposit \n4. Exit \nSelect from menu: ')
        if menu_input == '1':
            print '\nWithdraw: ' + str(balance + overdraft)
            print '\noverdraft : ' + str(overdraft)
           
        elif menu_input == '2':
            Withdraw_input = raw_input('Please enter the amount you would like to take out: ')
            if (int(Withdraw_input) > balance + overdraft):
                print 'Unable to withdraw'
               
            else:
                print 'You have withdrawn: ' + str(Withdraw_input)
                if (int(Withdraw_input) > balance):
                    overdraft_2 = overdraft - (int(Withdraw_input) - balance)
                balance = (balance + overdraft)- int(Withdraw_input)
                          
  
        elif menu_input == '3':
            Deposit_input = raw_input('Please enter the amount you would like to deposit: ')
            print 'The ammount you have deposited is: ' + str(Deposit_input)
            balance = balance + int(Deposit_input)
           
        elif menu_input == '4':
            print '\n Thank You for using MDX service '
            break
       
       
   
menu()
You for using MDX service '
            break
       
       
   
menu()
def menu():
    pin = '5050'
    balance = 200
    overdraft = 50
    while True:
        pin_input = raw_input('Isert PIN : ')
        if pin == pin_input:
            print
            print 'Please select from the following options:'
            print
            break
        else:
            print
            print 'Incorrect pin, Please try again'
            print
           
    while True:
        menu_input = raw_input('\n1. Balance \n2. Withdraw \n3. Deposit \n4. Exit \nSelect from menu: ')
        if menu_input == '1':
            print '\nWithdraw: ' + str(balance + overdraft)
            print '\noverdraft : ' + str(overdraft)
           
        elif menu_input == '2':
            Withdraw_input = raw_input('Please enter the amount you would like to take out: ')
            if (int(Withdraw_input) > balance + overdraft):
                print 'Unable to withdraw'
               
            else:
                print 'You have withdrawn: ' + str(Withdraw_input)
                if (int(Withdraw_input) > balance):
                    overdraft_2 = overdraft - (int(Withdraw_input) - balance)
                balance = (balance + overdraft)- int(Withdraw_input)
                           
  
        elif menu_input == '3':
            Deposit_input = raw_input('Please enter the amount you would like to deposit: ')
            print 'The ammount you have deposited is: ' + str(Deposit_input)
            balance = balance + int(Deposit_input)
           
        elif menu_input == '4':
            print '\n Thank You for using MDX service '
            break
       
       
   
menu()
You for using MDX service '
            break
      
menu()



 This is the coding for my Python. I was told to produce an electronic banking ATM system for Middlesex university.  

Copy and paste on python to produce the program.

3 comments:

  1. nice work sam, works well keep it up

    ReplyDelete
  2. this coding work but it will be good if have screen shots of it working.

    ReplyDelete