Write a Python program to create a class Person
with attributes for name
and age
. Write a method greeting
to return a greeting message with the person’s name.
Example 1:
Input: person = Person('John', 25), person.greeting()
Output: 'Hello, John!'
Example 2:
Input: person = Person('Emma', 30), person.greeting()
Output: 'Hello, Emma!'