asphongsai
asphongsai asphongsai
  • 18-12-2020
  • Computers and Technology
contestada

Define a function dice(n) that returns the sum of a random roll of n 6-sided dice. Example output in photo. Thank you

Define a function dicen that returns the sum of a random roll of n 6sided dice Example output in photo Thank you class=

Respuesta :

763396
763396 763396
  • 18-12-2020

Answer:

code (in python) is in the explanation

Explanation:

import random

def dice(n):

   count = 1

   t = list()

   while count <= n:

       i = random.randint(1,6)

       t.append(i)

       count += 1

   print(sum(t))

Hope this helps!

Answer Link

Otras preguntas

Jon has y stickers. He uses 20 stickers and divided the remainder equally between his two sisters. find the number of stickers each sister recieves
draw an arrow that points from the earth pole toward polaris
Holes by Louis Sachar Over a century ago, Camp Green Lake was very different to the way it is now. In what way has the area changed over time
Amelia had a landscaper plant 12 trees, Of these, 1/4 of them cost $25 each, 1/3 of them cost $35 each, and the rest of them cost $50 each. What was the tot
what kind of films and radio programs became popular during the Great Depression
need your help about this..
This emperor collected and codified all laws of the Byzantine age. Who was he? A) Constantine. B) Justinian.
which development was a direct result of the baby boom that followed world war two
what are three ingredients required for a healthy relationship
Which of the following situations best demonstrates direct rule?