Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Assignment: (Please screenshot Repl input & output.) Should be similar to the sample output for the final answer. M main.py 1 ### Don't change
Python Assignment: (Please screenshot Repl input & output.) Should be similar to the sample output for the final answer.
M main.py 1 ### Don't change this ### 2 import random NmLO0OOO def get_damage (attack, defense): # Complete this function defget roll rollstring): # Complete this function 11 12 def main_menu(): # Complete this function # HINT: Consider using a list here 13 14 15 16 ### Don't change this ### main_menu 17 What you need to know In this program, a roll string is a number, followed by a lowercase "d", followed by another number. The first number is the number of dice to roll. The second number is the number of sides on each die For example, 1d6 means there is one die with six sides. The total output of the roll is a random whole number between one and six, inclusive. 2d8 means there are two dice, each with eight sides. The total output of the roll is a random whole number between two and 16, inclusive. Since we are using a computer, we can have an input like 500d1000 (meaning a 1000-sided die, rolled 500 times) which would not be possible in real life. Sample output Each group of output is from a separate run of the program. The program only needs to run once each time. Remember that dice rolls (in real life and in this program) are random so your output probably won't match mine, and you may not get the same output each time for the same rolls. How many rounds do you want to play? 3 Input Player 1 and Player 2'3 rolls for round 1: 103, 103 Input Player 1 and Player 2'3 rolls for round 2: 106, 103 Input Player 1 and player 2'3 rolls for round 3: 106, 1010 Player 1 Attack: 1d3, Player 2 Defense: 1d3 >> Damage: 1 Player 1 Attack: 1d6, Player 2 Defense: 1d3 >> Damage: 3 Player 1 Attack: 1d6, Player 2 Defense: 1010 >> Damage: 0 How many rounds do you want to play? 2 Input Player 1 and Player 2's rolls for round 1: 100d5, 150d3 Input Player 1 and Player 2'3 rolls for round 2: 99d6,10007 Player 1 Attack: 100d5, Player 2 Defense: 15003 >> Damage: 6 Player 1 Attack: 99d6, Player 2 Defense: 100d7 >> Damage: 0 How many rounds do you want to play? 5 Input Player 1 and Player 2's rolls for round 1: 500d5, 500d5 Input Player 1 and Player 2'3 rolls for round 2: 600d6, 600d6 Input Player 1 and Player 2'3 rolls for round 3: 123d456, 123d123 Input Player 1 and Player 2'9 rolls for round 4: 1d10000000,101000000000000 Input Player 1 and Player 2's rolls for round 5: 1d1, 101 Player 1 Attack: 500d5, Player 2 Defense: 500d5 >> Damage: 0 Player 1 Attack: 600d6, Player 2 Defense: 600d6 >> Damage: 0 Player 1 Attack: 123d456, Player 2 Defense: 123d123 >> Damage: 20716 Player 1 Attack: 1010000000, Player 2 Defense: 101000000000000 >> Damage: 0 Player 1 Attack: 1d1, Player 2 Defense: 1di >> Damage: 0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started