Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Why I am getting this error in the code ''int' object is not callable'. Thanks for help!

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 554
    Answer it

    Here is my Code: 

    1. class Account:
    2. def __init__(self, owner, balance, deposit, withdraw):
    3. self.owner=owner
    4. self.balance=balance
    5. self.deposit=deposit
    6. self.withdraw=withdraw
    7. def __str__(self):
    8. return f'Account Owner{self.owner} Account Balance {self.balance}'
    9. def Deposit(self,deposit):
    10. self.balance+=self.deposit
    11. print ('Deposit Accepted')
    12. def Withdraw(self,withdraw):
    13. self.balance-=withdraw
    14. while self.withdraw>=self.balance:
    15. print ('Funds Unavailable')
    16. else:
    17. print ('Withdrawal Accepted')
    18.  
    19. acct1 = Account('Jose',100,0,0)
    20.  
    21. acct1.deposit(50)
    1. Below is the error:
    2.  
    3. TypeError Traceback (most recent call last)
    4. <ipython-input-56-a52dcc476376> in <module>
    5. ----> 1 acct1.withdraw(75)
    6.  
    7. TypeError: 'int' object is not callable

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: