Код:
def check_balance_ATM (operation):
user = 'admin'
user_file = user + "_balance.json"
with open (user_file, "r") as f:
admin_balance = json.load (f)
all_money = (sum (int (bancknote) * value for bancknote, value in admin_balance.items ()))
if operation == "check balance ATM":
print (f'Total at ATM: {all_money} UAH ',' \ n ')
print ('The ATM is:')
for bancknote, value in admin_balance.items ():
print (f "Banknote {bancknote} UAH - {value} pcs.")
add_transaction (user, operation, all_money)
return all_money
Последнее редактирование: