subject

[roll_until_sum. py] Write a program that simulates rolling two 6-sided dice, and repeatedly rolls them until a target sum is reached. A user should input what the target sum is. The program should output the result of rolling each die and the sum, finally reporting how many rolls it took to reach the target sum. For example:

This program rolls two 6-sided dice until their sum is a given target value.
Enter the target sum to roll for: 9

Roll: 5 and 3, sum is 8
Roll: 3 and 1, sum is 4
Roll: 4 and 1, sum is 5
Roll: 4 and 1, sum is 5
Roll: 6 and 3, sum is 9
Got it in 5 rolls!

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:10
How can i delete permalinks from a word press site?
Answers: 1
question
Computers and Technology, 22.06.2019 21:10
Dameas communication challenge is due to which factor
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
You know the right answer?
[roll_until_sum. py] Write a program that simulates rolling two 6-sided dice, and repeatedly rolls t...
Questions
question
Mathematics, 26.04.2020 07:24
question
Mathematics, 26.04.2020 07:25
question
Mathematics, 26.04.2020 07:41
question
Advanced Placement (AP), 26.04.2020 07:42
question
Physics, 26.04.2020 07:42
Questions on the website: 13722363