Tutorial 10

  1. Add inheritance to your monster (vampire, zombie, Sith, etc.)

    Take the monster class you wrote in tutorial 8. Adjust it so that it inherits from the Monster class we wrote in lecture. Upload your code to the help centre so that I can test it all in a large monster attack. Make sure that your code it well commented and that your tests will not run if I import them to another module (using __main__).

    The class should have a modified __init__ method (if necessary), an __str__ method, and a modified attack method.

  2. Fractions

    Finish the Fraction class we wrote together in lecture. The final code should have addition, subtraction, multiplication, indexing, str, and all the equality operators (lt,le,eq,ge,gt).