class Person:
pass
smith = Person()
smith.gender = "Female"
print(smith.gender) # prints 'Female' in console
This is the question I have, cuz Person class should not contain the attribute 'gender'.
I want to throw an error like "class 'Person' does not have attribute 'gender'" when people try to add this gender attribute to the object. How can I do that?