subject

Heads or tails - Import all random methods (eg import random)

- Generate a random number between 1-2

- Store the value in a variable called, 'rnd_value'

- If rnd_value equals 1, then output, 'heads' and if rnd_value equals 2, then output, 'tails'

- Use a variable called 'heads' assigned to 0, and a variable called, 'tails' assigned to 0

- Each time heads or tails is output, increment the variables heads to tails by 1

- Use a loop to repeat this process x1000, so that the variables heads/tails is being increment each time by 1

- After the loop is complete, then output the value of the variable heads and output the value of the variable tails.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, gabesurlas
You should try to photograph people on bright sunny days because the light will be best a) true b) false
Answers: 1
image
Computers and Technology, 22.06.2019 15:30, DestinyK8033
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
image
Computers and Technology, 23.06.2019 00:00, puppylove899
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, 573589
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
You know the right answer?
Heads or tails - Import all random methods (eg import random)

- Generate a random number...

Questions in other subjects:

Konu
Health, 20.05.2020 08:58
Konu
Mathematics, 20.05.2020 08:58
Konu
Biology, 20.05.2020 08:58