I'm new to Python and programming in general. Reading a few tutorials online and learning what I can.
My question is, how do I make uid increment on each instance of NewUser?
class NewUser:
uid = 0
def __init__(self, username):
self.username = username
self.uid += 1
x = NewUser("User1")
print(x.username)
print(x.uid)
y = NewUser("User2")
print(y.username)
print(y.uid)
My question is, how do I make uid increment on each instance of NewUser?