I want to create multiple bots with all their own unique id. But how can do this automatically for numerous bots and have all an other id? I can use bot1, bot2 but what if i want to use this with 100 bots?
class newbot:
id = randomid()
bot1 = newbot()
bot2 = newbot()
print bot1.id
print bot2.id #all the same id
The
idmember ends up being shared among all instances of your class because it’s defined as a class member instead of an instance member. You probably should write: