Question: Using Python: Create a program. The program should define a class called person that has one method called hello, and one attribute called name, which
-
Using Python:
-
Create a program. The program should define a class called person that has one method called hello, and one attribute called name, which represents the name of the person.
-
The hello method should print the following string to the screen:
My name is ____ and I am a _____
where:
-
The first blank should be the name attribute
-
The second blank should be the name of the class
-
After defining the class, there are three things you must do:
-
Instantiate an object of the class
-
Run the hello method of the instantiated object
-
(e.g., Greg.hello())
-
-
For grading purposes, you must also print the name of the class so I can be sure youve created a class
-
(The expected output is
)
-
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
