Question: Implement a python constructor that accepts one parameter: age (type integer). This parameter should initialize the similarly named class instance variable (these would start with
Implement a python constructor that accepts one parameter: age (type integer). This parameter should initialize the similarly named class instance variable (these would start with self. )
Implement a python method named sayHello. This python method should accept a single argument: name (type string). The result of this method should print the line
Hello, XXXX! Haven't seen you for YYYY years!
Where XXXX is the name supplied in the argument and YYYY is the class instance variable storing age, the one supplied during construction of the object.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
