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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:40, DisneyGirl11
Which is a benefit of getting information from a government website? a. the information will be easy to understand. ob. the information will be the most current. oc. the information can be trusted.
Answers: 1
image
Computers and Technology, 22.06.2019 06:50, phillipfruge3
Match the personality traits with their description
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, hannahliebl2000
Need asap write a short paper describing the history and differences between six sigma, waterfall, agile, and scrum models. understanding these models can give you a good idea of how diverse and interesting it development projects can be. describe what the rationale for them is and describe their key features. describe the history behind their development. at least 400 words
Answers: 1
image
Computers and Technology, 23.06.2019 11:00, jolleyrancher78
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
You know the right answer?
[roll_until_sum. py] Write a program that simulates rolling two 6-sided dice, and repeatedly rolls t...

Questions in other subjects: