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
What type of firewall works on the Session layer that creates a connection and allows packets to flow between the two hosts with
valkas [14]

Answer:

The correct answer is "circuit-level gateway"

Explanation:

A circuit-level gateway is a type of firewall that works at the session layer between the transport and application layer.

8 0
3 years ago
Www.microsoft.com is an example of this (two words) (last letter is e) and has to be (10 letters)
a_sh-v [17]

Answer:

domain name (2 words, 10 letters)

6 0
3 years ago
HEYY GUYS START REPORTING ALL THE SPAMMERS PLSS!!!!! For the spammers, I hope you go to hell &gt;:c!!!!!!!!!!!
Molodets [167]

Answer:

i totally agree

Explanation:

4 0
3 years ago
An array of integers can be assigned to a memory address in the ...
fenix001 [56]

Answer:

A :)

Explanation:

8 0
2 years ago
How do you implement instruction level parallelism
netineya [11]

Answer:

To obtain substantial performance enhancements, we must exploit ILP across multiple basic blocks.

Explanation:

8 0
3 years ago
Other questions:
  • The piece of hardware that contains the circuitry that processes the information coming in to the computer and tells the other h
    8·1 answer
  • Which of the following is true regarding a class and interface types? Group of answer choices You can convert from a class type
    9·1 answer
  • Write a function named "isValidPassword" that takes in a string and returns 1 if it stores a valid password and 0 otherwise, A v
    12·1 answer
  • Complete the method, print Multiples(), that takes in a positive integer n, and another positive integer, max. Print out all the
    15·1 answer
  • A photographer uses which of these tools to form an argument?
    14·2 answers
  • High level languages are closer to machine language than humans yes or no​
    12·2 answers
  • Look for at least ten materials tools or anything you see at home (tle)
    14·1 answer
  • WILL GIVE BRAINLIEST!! NO LINKS!!!
    12·2 answers
  • Help me with this two questions please
    15·1 answer
  • Consider a game that is searched using random restart hill climbing strategy. Assume that the success rate for the game is 25%.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!