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
Andru [333]
3 years ago
11

Heads or tails

Computers and Technology
1 answer:
Pani-rosa [81]3 years ago
5 0

import random

heads = 0

tails = 0

i = 0

while i < 1000:

   rnd_value = random.randint(1, 2)

   if rnd_value == 1:

       heads += 1

       print("heads")

   else:

       tails += 1

       print("tails")

   i += 1

print("Heads appeared {} times and tails appeared {} times".format(heads, tails))

I hope this helps!

You might be interested in
Assuming that we only support BEQ and ADD instructions, discuss how changes in the given latency of this resource affect the cyc
sertanlavr [38]

Answer:

Refer below.

Explanation:

Because we are inserting commands to beq, we will need an execution of the ALU, and then a register write. This result in and increase cycle time of the PC relative branch:

440+90=530ps.

As it is the longest time to execute, so its a critical path

6 0
3 years ago
Which of the following contributes to your active digital footprint
VLD [36.1K]
Personal information intentionally put on a secure website
3 0
3 years ago
Read 2 more answers
Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
Elden [556K]

Answer:

(number%100) / 10

(number%1000) / 100

Explanation:

5 0
3 years ago
Write a loop to print 10 to 90 inclusive (this means it should include both the 10 and 90), 10 per line.​
Masja [62]

Answer:

c = 0

for x in range(10,91):

   print(x, end=" ")

   c = c + 1

   if c>=10:

       print(" ")

       c=0

Explanation:

8 0
3 years ago
How is binary used in pixels and in sound?
FinnZ [79.3K]

Answer:

Sound needs to be converted into binary for computers to be able to process it. To do this, sound is captured - usually by a microphone - and then converted into a digital signal. The samples can then be converted to binary. They will be recorded to the nearest whole number.

Explanation:

is this it?

3 0
3 years ago
Read 2 more answers
Other questions:
  • What two images did you have to add to the wds server to handle the windows installation?
    7·1 answer
  • What is a common method for testing a spot weld?
    13·1 answer
  • The number of bits that can be transferred per second over a given transmission medium.
    6·1 answer
  • Which custom configuration is most likely to include a raid array?
    14·1 answer
  • What should be used to keep a tablet dry?
    13·1 answer
  • Face book suggests Friends for users based on their
    13·1 answer
  • What is the standard unit used to measure mass?​
    9·1 answer
  • In this exercise, you are asking the user to set a alpha numeric password for any website. Put some conditions.
    8·1 answer
  • Responsible use of computer is known as ................. .​
    11·1 answer
  • Type of Factor Beginning Frog Count Simulation 1 (Low) Simulation 2 (High)
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!