Deposit and Withdraw (Problem 8) - InfyTQ Solution in Python

Deposit and Withdraw (Problem 8)

InfyTQ Solution in Python




PROBLEM STATEMENT

Write a python function which accepts a list of strings containing details of deposits and withdrawals made in a bank account and returns the net amount in the account.

Suppose the following input is supplied to the function
["D:300","D:300","W:200","D:100"] where D means deposit and W means withdrawal,
then the net amount in the account is 500.


Sample Input Expected Output
["D:300","D:200","W:200","D:100"] 400
["D:350","W:100","W:500","D:1000"] 750



SOLUTION
SHARE If you find this useful, please share with your friends and Community.
CODE TOGETHER..GROW TOGETHER.
Newer Posts Newer Posts Older Posts Older Posts

More posts

Comments

Post a Comment

Sponsored Content