There are 36 possible combinations of two dice.
A simple pair of loops over range(6)+1 will e...
Computers and Technology, 25.04.2020 03:12 mrashrafkotkaat
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
Answers: 2
Computers and Technology, 22.06.2019 05:10
Read the code below. what will the computer print if the input for year_variable is 1700? if year_variable == 1776: print("your answer is correct. the declaration of independence was signed in “year_variable”.") elif year_variable < 1776: compute_variable = 1776 - year_variable. print("add “compute_variable“ years to your answer for the correct answer.") elif year_variable > 1776: compute_variable = year_variable - 1776 print("subtract “compute_variable” years from your answer for the correct answer.")
Answers: 1
Computers and Technology, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
History, 12.03.2021 18:20
English, 12.03.2021 18:20
Mathematics, 12.03.2021 18:20
Mathematics, 12.03.2021 18:20
Mathematics, 12.03.2021 18:20
Mathematics, 12.03.2021 18:20
Mathematics, 12.03.2021 18:20
English, 12.03.2021 18:20
History, 12.03.2021 18:20
Mathematics, 12.03.2021 18:20
Advanced Placement (AP), 12.03.2021 18:20