Python Write Program Rolls 3 20 Sided Die Adds Together Make Sure Display Output Use Dunge Q37283754

IN PYTHON

  1. Write a program that rolls 3 20-sided die and adds themtogether. Make sure to display their output so you can use it inyour Dungeon and Dragons game.

Sample output 1: You rolled a 60.

Sample output 2: You rolled a 3.


Answer


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

Please let me know if you have any doubts Please upvote this answer. Thanks!!

Please let me know if you have any doubts Please upvote this answer. Thanks!!

Leave a Comment

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