Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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? ") 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
What I have so far. I can't get the deposit function down right
import sys #account balance account_balance float (500.25) functions go here ) print ("What would you like to do?") account_balance float (500.25) def show_balance) print("Your current balance: ") print (account_balance) rn account_balance show_balance ()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