-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathclient.py
More file actions
25 lines (24 loc) · 962 Bytes
/
client.py
File metadata and controls
25 lines (24 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import random
random_list=list(set(random.randint(10000,99999) for i in range(9999)))
class Client:
i=0
def __init__(self,name,total_amount):
self.name=name
self.total_amount=total_amount
self.account_number=random_list[Client.i]
Client.i+=1
def withdrawn(self,amount):
if self.total_amount>=amount:
self.total_amount-=amount
print("The sum of {} has been withdrawn from your account balance.".format(amount))
self.current_balance()
return self.total_amount
else:
print("Your current account balance is not enough.")
def deposit(self,amount):
self.total_amount+=amount
print("The sum of {} has been added to your account balance.".format(amount))
self.current_balance()
return self.total_amount
def current_balance(self):
print ("Your current account balance is: {}".format(self.total_amount))