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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 11:10
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
question
Computers and Technology, 22.06.2019 11:20
The kurt vonnegut commencement speech, the neiman-marcus chocolate chip cookie recipe, and the get-well emails to the dying boy are examples of select one: a. social engineering b. hoax emails c. email viruses d. worms
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. what critical detail must she have before she starts designing the brochure?
Answers: 1
You know the right answer?
Heads or tails - Import all random methods (eg import random)

- Generate a random number...
Questions
question
Health, 04.11.2021 01:10
question
English, 04.11.2021 01:20
question
French, 04.11.2021 01:30
question
Mathematics, 04.11.2021 01:30
question
Health, 04.11.2021 01:30
question
History, 04.11.2021 01:30
question
English, 04.11.2021 01:30