subject

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

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:40
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until โ€˜esc' and show without narration options. b. click set up slide show, and then select the loop continuously until โ€˜esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
Using a conditional expression, write a statement that increments numusers if updatedirection is 1, otherwise decrements numusers. ex: if numusers is 8 and updatedirection is 1, numusers becomes 9; if updatedirection is 0, numusers becomes 7.
Answers: 1
You know the right answer?
Write a function called dicerolls() that takes as input a possible result r of a roll of a pair of d...
Questions
question
Mathematics, 12.03.2020 02:29
Questions on the website: 13722367