Question: Python 1. Import the random module to be used later. The random module allows use of the randrange method which will return a random number

 Python 1. Import the "random" module to be used later. The

Python 1. Import the "random" module to be used later. The random module allows use of the "randrange" method which will return a random number based on a range you specify. Example: print(random.randrange(1,10)) 2. Create a class named "Hero". This class should have attributes name, level, weaponname, life, damage, and attack. 3. Add a method to the class called "AttackPoints" that assigns a random number to the attack attribute and returns that value. 4. Add a method to the class called "imHit" that receives a number as a parameter, then subtracts that number from life and prints out "heroName screams - I'm hit!" where 'heroName' is replaced with the actual name. It also prints out the value in life stating how much is left 5. Create a new Hero object. 6. Assign values to the attributes name, level, and weaponname by prompting the user. Damage and Attack should statically be set to zero, and Life should be statically set to 100 initially 7. Create a child class called "Villian" that inherits everything from the hero class. 8. Add a new method to the Villian class called "FinalForm" that receives a name and prints out a message saying "This isn't even my final form nameparameter!" where "nameparameter is replaced with the value passed (should be the hero name). 9. Create a new Villian object 10. Write a loop to allow the user to battle Hero vs Villian until one of their life values reaches reaches zero. If the hero reaches zero first print out an appropriate message and exit. If the villain reaches zero first call the "FinalForm" method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!