Question
Write a Python script that reads in names and corresponding bank balances (integers, without a $ or commas) and makes a dictionary of the associations.
Write a Python script that reads in names and corresponding bank balances (integers, without a $ or commas) and makes a dictionary of the associations. You can prompt the user first for how many name-income pairs (s)he wants to enter. Use int(input()) for input. After constructing the initial balances, repeatedly do the following: Prompt for a transaction, using a code number, for each bank customer: a deposit (code 1), a withdrawal (code 2), or no transaction (code 0). Update the dictionary of bank balances and output the updated customer-balance associations. Make a dictionary of the transactions where the keys are the same as for the balance dictionary (names of customers); positive values represent deposits, negative values represent withdrawals, and a zero represents no transaction. Maintain a list of the transaction dictionaries (one for each iteration). When the loop exits, output the current balances and the list of transactions in a well-formatted table. This could be implemented with recursion as well as with a loop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started