SyntaxFix
Write A Post
Hire A Developer
Questions
On an object, you can achieve this with setattr
setattr
>>> class A(object): pass >>> a=A() >>> setattr(a, "hello1", 5) >>> a.hello1 5