Tutorial 10
-
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
Monsterclass 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. -
Fractions
Finish the
Fractionclass 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).