-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01.Atm.py
32 lines (21 loc) · 885 Bytes
/
01.Atm.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
melikeAccount = {
'name' : 'Melike Kulahci' ,
'accountNumber' : '12786' ,
'balance' : 4000 ,
'additionalAccount' : 2000
}
def withdrawMoney(account, amount):
print(f"Hello {account['name']}")
if (account['balance'] >= amount):
print("You can get your money")
else:
total = account["balance"] + account["additionalAccount"]
if(total >= amount):
additionalaccountuse =input("Should I use an additional account? (y/n) ")
if additionalaccountuse == 'y':
print("You can get your money")
else:
print(f"{account['accountNumber']} in your account no {account["balance"]} does not exist")
else:
print("Sorry, insufficient funds")
withdrawMoney(melikeAccount,5000)