![]() | |
Teachers Assignments Assignments Other Pages | Project 10: Assigned: Mon Nov 18 2024 In this project, you'll create a class and write functions that use objects. Part 0, 2 points: Create a new class to model Pokemon. Part 1, 0 points: You should now be able to create a Pokemon object like this: Use this to give your Pokemon class a meaningful docstring. Tester.Part 2, 3 points: Add a new function, >>> pyro = Pokemon()
>>> pyro.name = 'Flareon'
>>> pyro.number = 136
>>> pyro.types = ['Fire']
>>> pyro.hit_points = 71
>>> pyro.max_hp = 77
>>> has_full_hp(pyro)
False
>>> pyro.hit_points = 77
>>> has_full_hp(pyro)
True Tester.Part 3, 3 points: Add a new function, >>> schiggy = Pokemon()
>>> schiggy.name = 'Squirtle'
>>> schiggy.number = 7
>>> schiggy.types = ['Water']
>>> schiggy.hit_points = 56
>>> schiggy.max_hp = 56
>>> print_pokemon(schiggy)
Pokemon: Squirtle (7) HP: 56/56 Tester.Part 4, 5 points: Add a new function, >>> schiggy = Pokemon()
>>> schiggy.name = 'Squirtle'
>>> schiggy.number = 7
>>> schiggy.types = ['Water']
>>> schiggy.hit_points = 20
>>> schiggy.max_hp = 56
>>> spray_potion(schiggy)
>>> schiggy.hit_points
40
>>> spray_potion(schiggy)
>>> schiggy.hit_points
56
>>> schiggy.hit_points = 0
>>> spray_potion(schiggy)
>>> schiggy.hit_points
0 Tester.Submitting your Project: Make sure all your code is in a file labelled with your user name (everything before the @ in your school email address) followed by |