-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinterface_example.py
More file actions
50 lines (33 loc) · 789 Bytes
/
interface_example.py
File metadata and controls
50 lines (33 loc) · 789 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Interface
from abc import ABC, abstractmethod
class Bank(ABC):
@abstractmethod
def bankName(self):
pass
@abstractmethod
def bankLoanInterestRate(self):
print("1%")
class SBI(Bank):
def bankName(self):
print("SBI")
def bankLoanInterestRate(self):
print("5%")
class BOI(Bank):
def bankName(self):
print("BOI")
def bankLoanInterestRate(self):
print("10%")
class CB(Bank):
def bankName(self):
print("CB")
def bankLoanInterestRate(self):
print("15%")
sbi=SBI()
boi=BOI()
cb=CB()
sbi.bankName()
sbi.bankLoanInterestRate()
boi.bankName()
boi.bankLoanInterestRate()
cb.bankName()
cb.bankLoanInterestRate()