Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:00, xxbriannahollandxx
In a file-oriented information system, a work file stores relatively permanent data about an entity is created and saved for backup and recovery purposes stores records that contain day-to-day business and operational data is a temporary file created by an information system for a single task
Answers: 1
image
Computers and Technology, 22.06.2019 07:00, candiceforever123
Idon understand these and need some ! ?
Answers: 2
image
Computers and Technology, 23.06.2019 07:50, kmart4062
Apython programming question: assume s is a string of lower case characters. write a program that prints the number of times the string 'bob' occurs in s. for example, if s = 'azcbobobegghakl', then your program should print number of times bob occurs is: 2
Answers: 3
image
Computers and Technology, 23.06.2019 15:00, billlyyyyyyyyyy
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
Do you know the correct answer?
Heads or tails - Import all random methods (eg import random)

- Generate a random number...

Questions in other subjects:

Konu
Mathematics, 18.05.2021 20:50
Konu
History, 18.05.2021 20:50
Konu
Mathematics, 18.05.2021 20:50