Class
Class
"""
A class to represent a person.
Attributes:
name (str): The name of the person.
age (int): The age of the person.
gender (str): The gender of the person.
Methods:
greet(): Prints a greeting message with the person's name.
is_adult(): Returns whether the person is an adult (age >= 18).
"""
Parameters:
name (str): The name of the person.
age (int): The age of the person.
gender (str): The gender of the person.
"""
self.name = name
self.age = age
self.gender = gender
def greet(self):
"""Prints a greeting message with the person's name."""
print(f"Hello, my name is {self.name}.")
def is_adult(self):
"""
Checks if the person is an adult.
Returns:
bool: True if the person's age is 18 or older, False otherwise.
"""
return self.age >= 18