>>> class c(object): ... for i in range(10): ... locals()['A' + str(i)] = i ... >>> c.A0 0 >>> c.A7 7