We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a213c99 commit f36f2fdCopy full SHA for f36f2fd
oop/hasattr.py
@@ -0,0 +1,7 @@
1
+class Person(object):
2
+ def __init__(self,name,age):
3
+ self.__name=name
4
+ self.age=age
5
+
6
+a=Person("lili",18)
7
+getattr(a,"gender",setattr(a,"gender","male"))
0 commit comments