Question
Calculate the Balance - Deposit If the action is Deposit 'D', use a deposit function to add funds to the account Write a function called
Calculate the Balance - Deposit
If the action is Deposit 'D', use a deposit function to add funds to the account
Write a function called `deposit`.
Request from the user the amount to be deposited. This value should be stored in a variable called `deposit_amount`. Use both the `input` and `float` methods in order to ensure the `deposit_amount` is a float value.
Calculate a new account balance.
The calculation for depositing funds into the account is `account_balance = account_balance + deposit_amount`.
Print the new account balance.
Deposit Input
userchoice = input ("What would you like to do?\n") userchoice = 'B' deposit_amount = 200
Deposit Output
What would you like to do? How much would you like to deposit today? Deposit was $200, current balance is $700.25
Customer Deposit
Check It!Show diff
LAST RUN on 2/21/2020, 12:30:14 AM
Check 1 failed Output: What would you like to do? How much would you like to deposit today? Deposit was $200.00, current balance is $700 Expected: What would you like to do? How much would you like to deposit today? Deposit was $200.00, current balance is $700.25
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here is a Python function called deposit that performs the deposit operation and prints the new acco...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