TORONTO KIDS COMPUTER CLUB | Tuesday 7:30 Python Practice – 22.04.12.
20542
post-template-default,single,single-post,postid-20542,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Tuesday 7:30 Python Practice – 22.04.12.

15 Apr Tuesday 7:30 Python Practice – 22.04.12.

Question:

  1. Create a Python class Person with attributes: name and age of type string.
  2. Create a display() method that displays the name and age of an object created via the Person class.
  3. Create a child class Employee which inherits from the Person class and which also has two attributes position and salary.
  4. Create a method displayEmpolyee() that displays the name, age, position and salary of an object created via the Employee class.
  5. Create a employee object via an instantiation on the Employee class and then test the displayEmpolyee() method.
No Comments

Sorry, the comment form is closed at this time.