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

Recommended Answers

All 2 Replies

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.