I have a question about why the code below executes what it does.
class Account:
def __init__(self, id):
self.id = id
id = 800
id = self.id + id
acc = Account(123)
print(acc.id)
Why would this code print 123 instead of 923? Why does the id not work inside of the class?
id = self.id + idnotself.id = self.id + id.id != self.id, they are two completely different variables.acc.idwould return the value ofself.id__init__function