Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def deposit(name, sum):
- bank[name] = bank.get(name, 0) + int(sum)
- def withdraw(name, sum):
- bank[name] = bank.get(name, 0) - int(sum)
- def balance(name):
- if name not in bank:
- print('ERROR')
- else:
- print(bank[name])
- def income(percent):
- for k, v in bank.items():
- if v > 0:
- bank[k] = int(v * ((int(percent) / 100) + 1))
- bank = dict()
- operations_count = int(input())
- for i in range(operations_count):
- line = input().split()
- if 'BALANCE' in line:
- balance(line[1])
- elif 'DEPOSIT' in line:
- deposit(line[1], line[2])
- elif 'WITHDRAW' in line:
- withdraw(line[1], line[2])
- elif 'INCOME' in line:
- income(line[1])
- else:
- withdraw(line[1], line[3])
- deposit(line[2], line[3])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement