Greetings

Report a typo

Below is a class Person and you want to add a method greet to this class. This method is supposed to return the message Hello, I am name! where name is the name of this person.

Your task here is to define this method; read data from the input; create an instance of the class Person with the input value as the parameter name; call the method greet on this instance and print the result.

You can see an example below.

The input format:

The name of the person.

The output format:

Printed return value of the method greet.

Sample Input 1:

David

Sample Output 1:

Hello, I am David!
Write a program in Python 3
class Person:
def __init__(self, name):
self.name = name

# create the method greet here
___

Create a free account to access the full topic