@@ -14,17 +14,31 @@ def withdraw(self,Amount):
14
14
self .Balance = self .Balance - Amount
15
15
def deposit (self ,Amount ):
16
16
self .Balance = self .Balance + Amount
17
+ def display (self ):
18
+ print ("Account Number: " ,self .number )
19
+ print ("Account Name: " ,self .Name )
20
+ print ("Account type: " ,self .Atype )
21
+ print ("Account Balance: " ,self .Balance )
17
22
18
23
accno = int (input ("Enter your acc No:" ))
19
24
name = input ("Enter your Name:" )
20
25
obj = BankAccount (accno , name , "Savings" )
21
-
22
- print ("Account Number: " ,obj .number )
23
- print ("Account Name: " ,obj .Name )
24
- print ("Account type: " ,obj .Atype )
25
- print ("Account Balance: " ,obj .Balance )
26
- dep = int (input ("Enter the value to deposite: " ))
27
- obj .deposit (dep )
28
- print ("Account Balance: " ,obj .Balance )
29
- wid = int (input ("Enter the value to withdraw: " ))
30
- obj .withdraw (wid )
26
+ print ("\n 1.Account info\n 2.Deposit\n 3.Withdraw\n 4.Exit" )
27
+ while (1 ):
28
+
29
+ opt = int (input ("Select your option:" ))
30
+ if opt == 1 :
31
+ obj .display ()
32
+ elif opt == 2 :
33
+ dep = int (input ("Enter the value to deposite: " ))
34
+ obj .deposit (dep )
35
+ print ("Account Balance: " ,obj .Balance )
36
+ elif opt == 3 :
37
+ wid = int (input ("Enter the value to withdraw: " ))
38
+ obj .withdraw (wid )
39
+ print ("Account Balance: " ,obj .Balance )
40
+ elif opt == 4 :
41
+ print ("Exit" )
42
+ break
43
+ else :
44
+ print ("Invalid Option" )
0 commit comments