in Education by
So for a HW assignment, we're making a Yahtzee game. At least part of it. For preparation, our professors gave us a few questions to understand the main point of the assignment. 1) The following documentation is provided for one function: def roll_dice(): ''' rolls 5 dice, and returns a list of frequencies of each possible value for example, element [3] of the return value is how many 3's appeared ''' GIven this documentation, and the fact that the dice are six-sided cubes with the numbers 1,2,3,4,5,6 to choose from, which of these would be a correct return value from this function? Ans: [0, 1, 0, 2, 0, 2, 0] 2) Given the same documentation as the previous question, which of these would represent a dice roll with 4 2's? Ans: [0, 0, 4, 0, 0, 1] 3) Which of the following would represent a case where all five dice rolled the same value, considering the documentation in the first question? Ans: [0, 0, 0, 5, 0, 0, 0] 4) In the game of Yahtzee, a full house is defined to a situation where three of the dice have the same number, and the other two dice equal each other (but different from the first three). Which of these would represent a full house, given the documentation from the first question? Ans: [0, 2, 0, 0, 3, 0, 0] I don't understand how to interpret these types of questions. For 1) the range would be from (0,2)? Hence giving you the random amount of times for getting it? Or would we be using choices() with weights instead? For the second one, what does the '4' represent? The third question is along the same lines. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The numbers in brackets represent the frequency of a specific dice roll, corresponding to the numbers on the dice in order from 1 through 6. The listed answer for 2) would correspond to a dice roll of 4 3's, because the 4 is in the 3rd position in the array.

Related questions

0 votes
    How can I load a Python module given its full path? Note that the file can be anywhere in the filesystem, ... a configuration option. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm trying to follow PEP 328, with the following directory structure: pkg/ __init__.py components/ Core.py __init__ ... m missing here? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    How do I import other files in Python? How exactly can I import a specific python file like import file.py? How ... gap from extra.py? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I have a dataframe with which if a cell has a value other than "." then I need python to return ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 3, 2022 in Education by JackTerrance
0 votes
    I have the dataset that has the no_employees column that is the str object. whats is a best way to create the new ... 1-5 |Very Small Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    In Python 2.7, I could get dictionary keys, values, or items as a list: >>> newdict = {1:0, 2:0, 3:0} ... to return a list in Python 3? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    People including me know there is something in Python called __future__ and it appears in quite a few modules I read. ... am I right? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Here's the code: ''' file_path = (r'C:\Users\Luka\Desktop\Pyhton exercises\pi_digits.txt') with open( ... file_object: print(line) Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    I have several csv columns that store lottery numbers and some other info, like date when the number was ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    Suppose I have a Tensorflow tensor. How do I get the dimensions (shape) of the tensor as integer values? I ... 'Dimension' instead. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    float('nan') results Nan (not a number). It is very easy but how can I check? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I have the function and want to create a new column df['growth_factor'] which will have a derived value in it. ... can I achieve this? Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    I have 2 data frames df1 Name 2010 2011 0 Jack 25 35 1 Jill 15 20 df2 Name 2010 2011 0 Berry 45 25 1 ... used the code df1.add(df2) Select the correct answer from above options...
asked Jan 18, 2022 in Education by JackTerrance
0 votes
    I have a fixed list of services in a Linux server. I want to check the status of these services ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I was trying to write a quick-and-dirty script to generate plots easily. For that, I was using the following code ( ... do I do that? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
...