Last answered:

08 Nov 2022

Posted on:

08 Nov 2022

0

class problem ??

why does he keep printing none??





image

1 answers ( 0 marked as helpful)
Posted on:

08 Nov 2022

1

Hello Osama,

The methods you created (deposit and withdraw) uses the self.display() method, which already has a print() function. So, if you print something that already came out from the print function, that would return None. Therefore, you don't have to print self.balance, you just have to "call" it.

def deposit(self):
    money = float(input('How much do you want to deposit?'))
    self.balance += money
    self.display()



A small piece of advice. If you're just starting on learning how to code, it would help you a lot if you practice on writing a clean code early on. There are many tips you'll find in the course, it wouldn't be additional work.

Hope this helps,
Carl

Submit an answer