Question: fill in the code please: Write code that simulates the above process: Roll a 2 0 sided die Add a modifier of + 1 1

fill in the code please: Write code that simulates the above process:
Roll a 20 sided die
Add a modifier of +11
Check if the combined roll succeeds (roll + modifier >15)
In other words, compute three values: the result of Alice's roll (roll_result), the result of her roll plus Roga's modifier (modified_result), and a boolean value indicating whether the action succeeded (action_succeeded). Do not fill in any of the results manually; the entire simulation should happen in code. Hint: A roll of a 20-sided die is a number chosen uniformly from the array make_array(1,2,3,4,...,20). So a roll of a 20-sided die plus 11 is a number chosen uniformly from that array, plus 11.
[]:
possible_rolls =...
roll_result =...
modified_result =...
action_succeeded =...
# The next line just prints out your results in a nice way
# once you're done. You can delete it if you want.
print(f"On a modified roll of {modified_result}, Alice's action {'succeeded' if action_succeeded else 'failed'}")

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 Programming Questions!