- 4
Fill in the blanks to create an "isAdult" property.
class person : def__init__(self,age): self.age=int(age) _____________ def isAdult(self): if self.age > 18: return True else: return False
2 Respostas
+ 1
class person :
def__init__(self,age):
self.age=int(age)
@property
def isAdult(self):
if self.age > 18:
return True
else:
return False
+ 1
I have tried class person but it says that is wrong. Can someone please tell me what the correct answer is?