Unknown model· unknown
CodeFeedback Filtered Instruction — Synthetic (mixed generators)
Using the given class, write a constructor that creates an instance with age 10.…
- User
Using the given class, write a constructor that creates an instance with age 10. Additionally, add a method called "is_adult" that returns True if the person's age is 18 or above, and False otherwise. The time complexity of the "is_adult" method should be O(1) and the space complexity should be O(1).
- Assistant
class Person: def init(self): self.age = 10
def is_adult(self): return self.age >= 18