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
ira [324]
3 years ago
14

Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is

either heads or tails. Assume the input is a value greater than 0.
Computers and Technology
1 answer:
Nataly [62]3 years ago
7 0

Answer:

import random

decisions = int(input("How many decisions: "))

for i in range(decisions):

   number = random.randint(0, 1)

   if number == 0:

       print("heads")

   else:

       print("tails")

Explanation:

*The code is in Python.

import the random to be able to generate random numbers

Ask the user to enter the number of decisions

Create a for loop that iterates number of decisions times. For each round; generate a number between 0 and 1 using the randint() method. Check the number. If it is equal to 0, print "heads". Otherwise, print "tails"

You might be interested in
Algunos de los navegadores que existen son:
AlekseyPX

Answer:

Un navegador que no existe es firechicken.  ja ja  

A browser that does not exist is firechicken.   lol

Explanation:

Un navegador que no existe es firechicken.

¡Espero que esto ayude! :)

¡Marque el más inteligente!

A browser that does not exist is firechicken.

Hope this helps! :)

Please mark brainliest!

5 0
2 years ago
Joseph wants to take out the color of the background wall from an image what can Joseph do to achieve this​
snow_lady [41]

Answer:

Go to remove a background website

Explanation:

6 0
2 years ago
Read 2 more answers
What are the three major functions of a game engine?
Harrizon [31]
read that hope this helped

8 0
3 years ago
R15. Suppose there are three routers between a source host and a destination host. Ignoring fragmentation, an IP datagram sent f
maria [59]

Answer:

The answers are: an IP datagram, and 3 forwading tables.

Explanation:

An IP datagram sent from a source host to a destination host will travel through 8 interfaces. 3 forwarding tables will be indexed to move the datagram from source to destination.

8 0
2 years ago
The part of the computer that provides access to the internet is the
Arlecino [84]
<span>The part of the computer that provides access to the internet is the "modem".
</span>

A modem refers to a hardware device that enables a PC to send and get information over a phone line or a link or satellite association. On account of transmission over a simple phone line, which was at one time the most prevalent approach to get to the internet, the modem changes over information amongst simple and computerized designs progressively for two-way network communication.
4 0
2 years ago
Read 2 more answers
Other questions:
  • Propose, two new, proudly South African ways, which you can visualize that the internet of things, can be used in at work to mak
    7·1 answer
  • _______ allows you to specify how a photo is positioned in the text of your document.
    11·1 answer
  • An item such as a smart card is an example of the _______ form of authentication.
    10·1 answer
  • Explain why an IT department and a user support group may disagree about the responsibility for the development of end-user appl
    8·1 answer
  • Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binar
    12·1 answer
  • Write a program that prompts the user to enter a series of numbers between 0 and 10 asintegers. The user will enter all numbers
    6·1 answer
  • A student will not be allowed to sit in exam if his/her attendance is less than 75% .
    8·1 answer
  • Modify the Comments.java program from Programming Exercise 1-10 so at least one of the statements about comments is displayed in
    10·1 answer
  • Create a medical report for Wellness Hospital. Mention the hospital name as the heading and the report name as the subheading. T
    14·1 answer
  • Which type of service offers a preconfigured testing environment for application developers to create new software applications?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!