Computers and Technology

Write a function called dicerolls() that takes as input a possible result r of a roll of a pair of dice (i. e., an integer between 2 and 12) and an integer n. the function simulates repeated rolls of a pair of dice until n rolls of r have been obtained. your function should print how many rolls it took to obtain n rolls of r.
> > > dicerolls(7, 50)
it took 319 rolls to get 50 rolls of 7
> > > dicerolls(5, 150)
it took 1265 rolls to get 150 rolls of 5
> > > dicerolls(11, 100)
it took 1971 rolls to get 100 rolls of 11

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:00, Jasten
For all machines-not just hammers- the user applies force force to the machine to the machine over a certain distance. a. input b. output c. duo d. none of the above
Answers: 1
image
Computers and Technology, 22.06.2019 17:50, ImBADatmath8743
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
image
Computers and Technology, 22.06.2019 19:00, SoccerHalo
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
image
Computers and Technology, 22.06.2019 20:40, broang23
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
Do you know the correct answer?
Write a function called dicerolls() that takes as input a possible result r of a roll of a pair of d...

Questions in other subjects:

Konu
Mathematics, 12.10.2020 08:01
Konu
Mathematics, 12.10.2020 08:01
Konu
Mathematics, 12.10.2020 08:01