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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!