answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
weqwewe [10]
2 years ago
7

Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. E

ach of the numbers should be the modified roll from one simulation. Then, call your function once to compute an array of 7 simulated modified rolls. Name that array observations.
Computers and Technology
1 answer:
Bas_tet [7]2 years ago
6 0

Answer:

import random

def simulate_observations():

   #this generates an array of 7 numbers

   #between 0 and 99 and returns the array

   observations = random.sample(range(0, 100), 7)

   return observations

#here,we call the function created above and print it

test_array = simulate_observations()

print(str(test_array))

You might be interested in
Given three dictionaries, associated with the variables, canadian_capitals, mexican_capitals, and us_capitals, that map province
Nookie1986 [14]

Answer:

The Python code to combine the three dictionaries are is given as follows:

  1. canadian_capital = {
  2.    cash: "SOME VALUES",
  3.    assets: "SOME VALUES"
  4. }
  5. mexican_capital = {
  6.    cash: "SOME VALUES",
  7.    assets: "SOME VALUES"
  8. }
  9. us_capital = {
  10.    cash: "SOME VALUES",
  11.    assets: "SOME VALUES"
  12. }
  13. nafta_capital = {
  14.    canadian: canadian_capital,
  15.    mexican : mexican_capital,
  16.    us: us_capital
  17. }

Explanation:

<u>Line 1 - 14 :</u>

Create three Python dictionaries and name them as <em>canadian_capitals, mexican_capital </em>and<em> us_capitals</em>. Please note a Python dictionaries should be enclosed in curly braces { }.  

We just define two samples of relevant keys (<em>cash </em>and <em>asset</em>) in each of the dictionaries. Python dictionary can map a key to a value.

Since we are not given any capital values from the question,  a dummy string "<em>SOME VALUES</em>" is tentatively set as the value for each of the keys.

In practice, we should replace those dummy strings with the real values of capital. The values can be a number, a string, a list and even a nested dictionary.

<u>Line 16 - 20 : </u>

Create one more Python dictionary and name it as <em>nafta_capital</em>.

Since our aim is to combine the three previous dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em>) and associate it with <em>nafta_capital</em>, we can define three different keys (<em>canadian, mexican </em>and <em>us</em>) in our dictionary nafta_capital.

As mentioned, a value associated with a key can be a nested dictionary. Hence, we just map <em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> as the value of the keys (<em>canadian, mexican </em>and<em> us</em>) in dictionary<em> nafta_capital,</em> respectively,

By doing so, we have managed to combine three target dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> ) into a single dictionary, <em>nafta_capital</em>.

4 0
1 year ago
Write a program to help you feed your friends at a party by doing some math about square pizzas. Assume the grader defines a str
Nina [5.8K]

Answer:

Following are the program in the Python Programming Language.

#get input from the user length of the pizza

inputStr = input('Enter the length of pizza: ')

#convert input into float

L = float(inputStr)

#initialize the area of the pizza

A = L*L

#calculate the amount of peoples can eat pizza

men = int(A/100)

#print the number of peoples

print('\nPizza can be eaten by {} people'.format(men))

<u>Output</u>:

Enter the length of pizza: 20

Pizza can be eaten by 4 people

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, set a variable that get length input from the user.
  • Set variable 'L' that convert the input from the user into the float data type.
  • Set variable 'A' that stores the area of the pizza.
  • Set variable 'men' that store the amount of peoples can eat pizza.
  • Finally, print the number of peoples can eat pizza.
3 0
2 years ago
Select the correct navigational path to freeze the top row of your worksheet. Select the panes you wish to freeze. Click the tab
Artemon [7]

Yeah, Your steps ar correct. Let's analyse those steps more easily by the following steps:

\Large{ \boxed{ \bf{ \color{aqua}{Freeze \: panes:}}}}

Freeze panes is a feature in spreadsheet applications, such as Microsoft Excel, LibreOffice Calc, and Google Sheets. It "freezes" a row or column, so that it is always displayed, even as you navigate the spreadsheet.

❍ Freezing panes is especially useful if your spreadsheet has a header row, that you want to always be visible.

  • Select the row below the row(s) you want to freeze. In our example, we want to freeze rows 1 and 2, so we'll select row.
  • Click the View tab on the Ribbon.
  • Select the Freeze Panes command, then choose Freeze
  • Panes from the drop-down menu. ...
  • The rows will be frozen in place, as indicated by the gray line.

<u>━━━━━━━━━━━━━━━━━━━━</u>

6 0
1 year ago
Read 2 more answers
Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of s
alekssr [168]

Answer:

"public static void passAList(ArrayList<Integer> myList, int[] intArr)", is the correct answer for the above question.

Explanation:

Missing information :

  • The option is missing but the question states "choose from the following". The correct defining syntax is defined above.

Detailed Explantion :

  • The above question asked about syntax which takes the value of list and array as an argument.
  • It is already defined in the above syntax.
  • And the value is passed by the user at the time of function call.
  • The array list is defined by the help of the ArrayList class and the array is defined by the help of the "[]" symbol.

3 0
1 year ago
Memory is a _____________ that includes the organization and shaping of information by processing, storage, and retrieval of inf
vaieri [72.5K]

Answer:

A. <em>Encoding Process </em>

Explanation:

Memory is an <em>encoding process </em>that includes the organization and shaping of information by processing, storage, and retrieval of information.

There are two types of memory in computing, <em>RAM </em>and <em>ROM</em>. <em>RAM </em>stands for <em>Random Access Memory</em>. It I the core memory of the computer and it is especially faster regarding reading and writing process. As an analogy, RAM memory is like the “<em>Short-term</em>” memory of the computer. <em>ROM </em>stands for <em>Read-Only Memory</em>, this is the type of memory in charge of permanently storing data in the computer. It contains the necessary information to run the computer. As an analogy, <em>ROM </em>memory is like the “<em>long-term</em>” memory of the computer.

3 0
1 year ago
Other questions:
  • How frequently should computers containing ehr information be backed up?
    14·1 answer
  • In the game Beehive, you play the role of a worker bee who must watch over her hive. Your duties include (among others) directin
    12·2 answers
  • Create a division formula.
    9·1 answer
  • What level of fault is the following example: North Lake Hospital followed all of the HIPAA policies and procedures for securing
    12·2 answers
  • Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
    9·1 answer
  • Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 19
    6·1 answer
  • A triangular number is a number that is the sum of the integers from 1 to some integer n. Thus 1 is a triangular number because
    11·1 answer
  • A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer
    14·1 answer
  • Write an expression to print each price in stock prices.
    15·1 answer
  • Write a MATLAB function named average_of_scores_with_drops The function will have two inputs and two return values. The first in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!