- 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

27th Jun 2021, 7:06 AM
Tia
2 Antworten
+ 1
class person : def__init__(self,age): self.age=int(age) @property def isAdult(self): if self.age > 18: return True else: return False
26th Jul 2021, 7:22 AM
Peshala Mihira
Peshala Mihira - avatar
+ 1
I have tried class person but it says that is wrong. Can someone please tell me what the correct answer is?
23rd Dec 2021, 10:58 PM
Anish Krishnamurthy
Anish Krishnamurthy - avatar