subject

There are 36 possible combinations of two dice.
A simple pair of loops over range(6)+1 will enumerate all combinations.
The sum of the two dice is more interesting than the actual combination.
Create a dict of all combinations, using the sum of the two dice as the key.

Each value in the dict should be a list of tuples; each tuple has the value of two dice.
The general outline is something like the following:

d= {}
Loop with d1 from 1 to 6
Loop with d2 from 1 to 6
newTuple ← ( d1, d2 ) # create the tuple
oldList ← dictionary entry for sum d1+d2
newList ← oldList + newTuple
replace entry in dictionary with newList

Loop over all values in the dictionary
print the key and the length of the list

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Which of the following are types of formatting you can apply to a spreadsheet? choose all that apply.
Answers: 3
question
Computers and Technology, 22.06.2019 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
How is the number 372 written when expanded out to place values in the base 8 (octal) number system? a. 2 x 4 + 3 x 2 + 4 x 1 b. 3 x 64 + 7 x 8 + 2 x 1 c. 3 x 8 + 7 x 7 + 2 x 6 d. 3 x 100 + 7 x 10 + 2 x 1
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
You know the right answer?
There are 36 possible combinations of two dice.
A simple pair of loops over range(6)+1 will e...
Questions
question
Mathematics, 25.09.2019 07:30
question
English, 25.09.2019 07:30
question
Mathematics, 25.09.2019 07:30
question
History, 25.09.2019 07:30