Question: USING Python programming write program. 1. Define a new array called weapons and add 6 different weapon names in the array, with increasing levels of
USING Python programming write program.
1. Define a new array called weapons and add 6 different weapon names in the array, with increasing levels of weapon strength. Use Fist, Knife, Club, Gun, Bomb, Nuclear bomb
2. Roll the dice (1-6) to choose which weapon you must use. Save the roll in a variable called weapon Roll. Add your weaponRoll to the hero's combat strength Use this variable as an index into the weapons array and print out the name of the hero's weapon.
3. Define the following condition: if weaponRoll is less than or equal to 2, print out "You rolled a weak weapon, friend". But if weaponRoll is less than or equal to 4, print out "Your weapon is meh" Else, print out "Nice weapon, friend! "
4. If the weapon rolled is not a Fist, print out "Thank goodness you didn't roll the Fist..."
5. Add error handling on all inputs eg. if input is not int, print an error message and halt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
