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:

  1. Instantiate an object of the class

  2. Run the hello method of the instantiated object

    1. (e.g., Greg.hello())

  3. For grading purposes, you must also print the name of the class so I can be sure youve created a class

    1. (The expected output is )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!