-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAcc.py
48 lines (36 loc) · 840 Bytes
/
Acc.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""class Acc:
def __init__(self,bal,info):
self.bal=bal
self.info=info
def debit(self,amount):
self.bal-=amount
print("debited", amount)
def credit(self,amount):
self.bal+=amount
print("credited", amount)
def print(self):
return self.bal
def __pri(): #private
print("hello")
def hello(self):
self.__pri
a1=Acc(1000000,12345)
a2=Acc(299,44)
print(a1.hello())
print(a2)
del a2
a1.debit(10000)
a1.credit(50000)
print("Balance=",a1.print()) """
class Circle:
def __init__(self,r) :
self.r=r
def area(self,r):
ar=3.14*self.r*self.r
print(ar)
def peri(self,r):
pe=3.14*2*self.r
print(pe)
c1=Circle(12)
c1.area(12)
c1.peri(12)