-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathOOP.py
43 lines (43 loc) · 1.21 KB
/
OOP.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
import abc
class Bank(abc.ABC):
@abc.abstractmethod
def Accountname(self):
pass
@abc.abstractmethod
def Deposit(self):
pass
@abc.abstractmethod
def Withdraw(self):
pass
class HBLBank(Bank):
def Accountname(self):
a="Muhammad Hassaan Iqbal"
b=input("Enter your name: ")
if b == a:
print("Your logged in")
else:
print("Accountname not correct")
def Deposit(self):
c=input("Enter the amount you want deposit: ")
return c
def Withdraw(self):
d=input("Enter the amount you want to withdraw: ")
return d
class MeezanBank(Bank):
def Accountname(self):
a="Muhammad Hassaan Iqbal"
b=input("Enter your name: ")
if b == a:
print("Your logged in")
else:
print("Accountname not correct")
def Deposit(self):
c=input("Enter the amount you want deposit: ")
return c
def Withdraw(self):
d=input("Enter the amount you want to withdraw: ")
return d
obj2=MeezanBank()
obj2.Accountname()
print("The amount you deposited is",obj2.Deposit())
print("The amount you withdrawn after deposition is",obj2.Withdraw())