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 
  1. Write a function called `deposit`.
  2. 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.
  3. Calculate a new account balance.
  4. The calculation for depositing funds into the account is `account_balance = account_balance + deposit_amount`.
  5. 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

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!