181k views
4 votes
Question 1. 3 Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. Each 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

User Sam Yates
by
7.5k points

1 Answer

4 votes

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))

Step-by-step explanation:

User Elliot Winkler
by
6.4k points