1answer.
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
Levart [38]
3 years ago
10

Write a program which simulates the result of a person choosing 3 objects in a random order out of a box containing 3 objects in

total. The box contains the following 3 objects: apple, ball, cat. A single selection pass of your program describes the random selection of 3 objects out of the box, without replacement. This means that a particular object can only be selected from the box once. At the beginning of a pass, the box is full, so it contains all 3 objects. After an object is selected from the box, your program will print the name of the object and then choose another object without replacing the previous object. The selection process repeats 3 times until the box is empty
Computers and Technology
1 answer:
Leviafan [203]3 years ago
6 0

Answer:

Explanation:

The following code is written in Python, it loops through a list (box) of the objects and randomly choosing one of the objects. Prints that object out and removes it from the list. Then repeats the process until the box is empty.

import random

box = ['apple', 'ball', 'cat']

print(box)

for x in range(len(box)):

   pick = random.randint(0,len(box)-1)

   print("Pick " + str(x+1) + ": " + box[pick])

   box.remove(box[pick])

print(box)

You might be interested in
You type a web address in your web browser. order the steps, which describe the internet name resolution process for the web add
padilas [110]
First of all let's make it clearer, what is meant by "domain name resolution"?
"Domain name resolution" is the process of translating your web address into its corresponding IP address. e.g. translating (www.brainly.com to 104.16.32.180)
Computers cannot understand the human language they only can understand numbers that's why we need this process.

So, the process (in a very simple way) is divided into four steps:
1) Lookup "root nameservers"
2) Lookup "Top Level Domain TDL nameservers"
3) Lookup "domain nameservers"
4) Lookup "subdomain nameservers" [if exist]

If you still confused please check out this video https://www.youtube.com/watch?v=BCjUbpIzRs8&index=10&list=PL4bq-KmCeyBmMvBB3-RT6ikdp8ljV9GeT

6 0
3 years ago
Which device makes telecommunications possible?
Dmitrij [34]
A. modem or d. voice input. Not a port because a port allows one to insert a peripheral device but not really communicate. I have no idea what an expansion slot is. It could be d. voice input because this allows a person to hold an audible conversation.

But  I'd go for modem because a modem lets you connect devices like laptops, tablets, phones, computers etc. and share data between them. So things like mailing are possible (I THINK)!  <span />
7 0
3 years ago
1. The precious metals needed to make computer chips, graphic cards, and transistors are found in only a small population of cou
dexar [7]

Answer:

it means that they can charge companies to come mine it making them more wealthy they can also upscale the materials needed to make it as they are the only countries that sell it so they have no one to compete with

3 0
3 years ago
_______________ bytes of storage are needed to represent the name "sarah." two three five ten
Sholpan [36]
The answer is five...
4 0
3 years ago
It is very easy to change data into charts<br> what is a Microsoft Excel Microsoft Outlook or both​
Vadim26 [7]
It’s microsoft Excel
8 0
3 years ago
Other questions:
  • A usability study compares the number of page visits on a web site. Half of the participants saw Version A of the home page. The
    13·1 answer
  • The united states attempted to halt the communist revolution in cuba by​
    7·1 answer
  • What is the value of vals[4][1]? double[][] vals = {{1.1, 1.3, 1.5}, {3.1, 3.3, 3.5}, {5.1, 5.3, 5.5}, {7.1, 7.3, 7.5}};
    6·1 answer
  • which of the following is not a windows accessory? a. sticky notes b. windows 8 c. sound recorder or d. paint
    8·2 answers
  • Create a Python program by defining a function that calculates the year of birth of a person whose age is known to you.(You may
    7·1 answer
  • Why is network security important? Check all of the boxes that apply. A. Network security allows organizations to continue to fu
    8·1 answer
  • Explain why interrupt times and dispatch delays must be limited to a hard real-time system?
    8·1 answer
  • Explain what a datalist element does and is used for.
    12·1 answer
  • What are the cloud storage components
    6·1 answer
  • A.m. client appears at the top of every page
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!