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

find the coordinate of K' after a Glide reflection of the triangle: translation 4 units up and 4 units right then a reflection across the line y = 1.Part 3a​
A 50.0 Watt stereo emits sound waves isotropically at a wavelength of 0.700 meters. This stereo is stationary, but a person in a car is moving away from this st
ANSWER ASAP Choice 1 Choice 2 Choice 3 Choice 4
The fiscal year-end unadjusted trial balance for Garcia Company is found on the trial balance tab. Rent expense and salaries expense are equally divided between
Attached earlobes are recessive trait in humans in the tree below people with attached earlobes are shaded in which best describes a person label to
The underline part of the sentence
Point-Slope form of the line that goes through (2, 7) with a slope of -4, please!
solve for X will give brainliest!!
the growth of pollen tube tubes towards ovules is due toa) hydrotropismb)chemotropismc) geotropismd) phototropismo​
Consider the following system of equations. y =6x²+1, y = x² +4 Whích statement describes why the system has two solutions?