2 Write Program Rolls 3 20 Sided Die Adds Together Make Sure Display Output Use Dungeon Dr Q37284067

2.

Write a program that rolls 3 20-sided die and adds themtogether. Make sure to display their

output so you can use it in your Dungeon and Dragons game.

Sample output 1:

You rolled a 60.

Sample output 2:

You rolled a 3.

IN PYTHON


Answer


from random import randintd1 = randint(1, 20)d2 = randint(1, 20)d3 = randint(1, 20)print(“You rolled a ” + str(d1 + d2 + d3) + “.”)

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.