+ 3
Python bank account balance I need help
Here’s my code balance = int(input()); withdraw = int(input()); balance-=withdraw print("your balance" , balance)
47 Antworten
+ 3
It has to be:
balance=int (input ())
withdraw=int (input ())
balance-=withdraw
print ("your balance",balance)
Without the ";"
+ 5
It looks like your y in 'your balance' should be upper case.
+ 3
Look closer at expected output.
Format is asking to Capitalize y and add colon at text end ':' so required statement is :
print( "Your balance:", balance)
+ 2
It’s introduction to python course
Interacting with users
Bank account balance challenge
+ 2
That's python not C++ remove the columns ";"
+ 1
Introduction to python, interacting with users and bank account challange
Here’s my code
balance = int(input());
withdraw = int (input());
balance-=withdraw
print("your balance" , balance)
+ 1
"Introduction to Python" is only available to new accounts.
+ 1
Please provide the complete task description so we can check on it.
+ 1
Please provide the task description, not the number of XP
+ 1
Thanks
+ 1
hellobud I don't really see what the problem is with your code it's fine unless you did not follow the instructions. It would be nice if you showed the question
+ 1
Also loss those semicolons
+ 1
class BankingSystem:
def __init__(self, balance = 0):
self.balance = balance
def withdrawFunds(self, withdrawfunds):
balance = balance - withdrawfunds
def depositFunds(self, depositfunds):
balance = depositfunds + self.balance;
def displayfunds(self):
print(self.balance);
def displayFunds(self):
print(f"Your account balance is:", self.balance);
def DisplayFunds(self):
print("Your account balance is: %d" % self.balance)
def deposit(self):
pass
withdraw = int(input())
progObj = BankingSystem(300)
progObj.depositFunds(1000)
progObj.depositFunds(1000)
#progObj.withdrawFunds(withdraw)
progObj.displayfunds()
progObj.displayFunds()
progObj.DisplayFunds()
Different ways to accomplish this
+ 1
I know.. it is a c++ /java habit lol it doesnt affect the program at all though
+ 1
Here The Code
def calculate_balance(balance, annual_interest_rate, monthly_payment):
for i in range(12):
balance = balance - monthly_payment
balance = balance + (balance * (annual_interest_rate / 12.0))
return balance
balance = 42
annual_interest_rate = 0.2
monthly_payment = 50
print("Remaining balance:", calculate_balance(balance, annual_interest_rate, monthly_payment))
0
What exactly the issue that you are running into? (Also, no need for semicolons).
0
It says my answer is incorrect
0
Please don't post duplicate questions: https://www.sololearn.com/Discuss/3188724/?ref=app
Also, you may want to use some kind of concatenation or a formatted string.
0
So is my code incorrect
0
You just stated that something told you it was.