0

Dear Members,
I am quite new to python and I have to implement the bank account code. At this point I just want to
Ask is whether I am moving in correct direction or not. I am not looking for any code but needs suggestion.

So far for bank account code I have gathered following requirements.

1) Class to implement bank account

2) function to check balance
3) To withdraw money
4) type of account
5) to enter correct username and password
6) type of account like current or saving account

Below I am giving a blueprint of my code. Kindly ignore the syntax at this moment please.

All help and criticism will be highly helpful to me.
Thanks and regards,
Pratik

class  BankAccount:
'some comments'
authorisedCode = 0;

def_init_(self, name, password, balance):

self.name = name
self.password = password
self.balance = balance

def authorisation(self, name, password):

if(  self .name  == name && self.password == password)
	print "access granted"
	authorisedCode = 1;
	else
         print " wrong code";


def CurrentBalance(self)

// some implementation here

def Withdrawal(self):
// implementation of withdrawal

def extraService:
// implementation to check whether credit card is there or not

Edited by Ezzaral: Switched to regular thread and fixed tags.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by jainpratik2
0

This doesn't belong in code snippets as it is a question, hopefully a mod will fix that soon. Python comments are preceded by # or are within ''' ''' also your indentation is way off. Also, given this code how do you intend the "ATM" to know the customers password? I'd think about implementing a dictionary "I'd use a pickled file". Thanks for putting in effort before posting, next time just post questions as a normal post, code snippets are essentially for finished codes.

0

yeah I am sure I will take note of your advice the next time I will post.
But for solution of my problem

could you please elaborate what you mean by" implementing a dictionary "I'd use a pickled file".
Also at the moment I am not concerned with syntax as I will check on google for syntax.
Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.