+ 1
Python program bug
https://code.sololearn.com/c4NfAJIfFm9G/#py Iv'e built a program which works like a bank. I'm having a problem with the transaction function. For some reason is saves two strings of both transactions. i commented the whole code so you can understand what anything does. To get the to the problem you must create two accounts, then try to transfer funds from one account to the other. and then check the transactions list.
1 Answer
0
You created many class attributes instead of instance attributes.
Doing so, for example, the variable "__transcations" in class account is created the first time code is executed and changed by any instance.
Just move these variables to "def __init__" and instance them by adding 'self.' in front of them.
https://code.sololearn.com/cXRjmFm285hU/?ref=app