I am trying to write a class which accepts *args and so i need example of passing *args in init. i dont know how many parameters will be passed to *args and so not sure how will assign them.
class bank():
def __init__(self, *args ):
if args is not None:
for i in in argv:
self.name=i
#now if there are more argument how do i assign them???like i am using "account" and "name" in below function ("withdraw")
#but i dont want to pass this in "balance", i want pass just "name"
def balance(self,name):
bal="select account from banktab where name = '%s'" %(self.name)
# result=b.query(bal)
print (bal)
def withdraw(self,name,account):
wit="select account from banktab where name = '%s'" %(self.name)
print (self.name)
print (self.account)