Question: I have a below problems and i need to fix my codes! [ Python 3.6] Calculate the Balance - Deposit If the action is Deposit
I have a below problems and i need to fix my codes! [ Python 3.6]
Calculate the Balance - Deposit
If the action is Deposit 'D, use a deposit function to add funds to the account
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
- 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.
========================================
import sys
#account balance account_balance = float(500.25)
#<--------functions go here--------------------> #printbalance function
#deposit function
#withdraw function
#User Input goes here, use if/else conditional statement to call function based on user input
userchoice = input ("What would you like to do? ") deposit = input ("How much would you like to deposit today? ")
if (userchoice == 'B'): deposit () print("Deposit was "+(deposit)+", current balance is $700.25 ") print (account_balance)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
