In this piece of code when I write name of the class in the bold part, the account_id differs every time, but when I use self instead, the account_id will be the same number as much as the number of objects, in the reference I’ve learnt from, it said ther’s no difference between using the name of class and key word self in such situation, but I see in this example that it differs, what’s the reason? Is what I learnt wrong?
class BankAccount():
initial_acount_id = 1000110011
def __init__(self, fname, lname, deposit = 0) -> None:
**BankAccount.initial_acount_id += 12**
self.account_id = self.initial_acount_id
self.fname = fname
self.lname = lname
self.deposit = deposit
fir = BankAccount("ali", 'zarei')
sec = BankAccount('mehrdad', 'rsccz', 50)
thi = BankAccount('sdad', 'ccjkj')
print(fir.account_id)
print(sec.account_id)
print(thi.account_id)