Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Improve previous examples

  • Take the previous example Python: Inheritance - another level and the example file called examples/oop/inheritance/ball_shape.py and change it so the Ball class will accept x, y, z, r.
  • Add a method called move to the new Ball class that will accept dx, dy, dz.
  • Implement a method that will return the volume of the ball.