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
Which of the following is the BEST solution to allow access to private resources from the internet?
notsponge [240]
FTP stands for file transfer protocol. FTP is used to transfer files between computers over the Internet. FTP servers can be setup to allow users to access the information anonymously or require registration for access.
7 0
3 years ago
Which ics function records time accounting and procures needed items?
vladimir1956 [14]
It is the finance / administration function that records time accounting and procures the needed items
7 0
3 years ago
A government agency is getting rid of older workstations. The agency will donate these workstations, along with other excess com
algol [13]

The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

<h3>What is a hard disc?</h3>

The "DoD Standard" is a term used during the data sanitizing industry and refers to DoD 5220.22-M, and the further discussion can be defined as follows:

The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

The sparging eliminates statistics to entirely delete the gravitational flux from electronic media.

Hard drives as well as other data storage devices, for example, computer tapes, retain magnetic data.

It could no longer be seen as storage after a disk is degaussed.

Therefore, the final answer is "Using the DoD 5220.22-M method and  Degauss media with a magnet".

Learn more about hard disc at:

brainly.com/question/13329582

#SPJ1

3 0
2 years ago
What should you commit to your family members?
olganol [36]

Answer:

Find some time to do an activity that everyone in the family will love. Maybe share a movie night, trip to the park, or play your favorite game. Don't forget that old saying, “the family that plays together, stays together.” Doing fun things as a family can help to keep everyone's spirits up and strengthen ties.

Explanation:

HOPE IT'S HELP

PLEASE MARK AS BRAINLEST ANSWER

7 0
3 years ago
Write an example method that overrides the operator to create a new book whose title is a concatenation of the titles of two boo
Anastasy [175]

next time m8 mmmmmdsaasd

5 0
3 years ago
Other questions:
  • You visit two websites about inventions of the 21st century. One has .edu in the URL address and the other has .com. Which site
    6·2 answers
  • a ____ consists of wires connecting the cpu and other parts of the computer. The _____ transfers data between CPU and memory uni
    6·1 answer
  • What is software that helps a computer operate efficiently and keeps track of data on a computer?
    14·1 answer
  • __________is threatening to steal or actually stealing information from a company and then demanding payment to not use or relea
    13·1 answer
  • Write the definition of a class clock. the class has no constructors and three instance variables. one is of type int called hou
    12·1 answer
  • When planning a presentation, there are several factors you need to consider. Which of the following is one factor you should co
    8·1 answer
  • BRAINLIEST Which function will add a name to a list of baseball players in Python?
    11·2 answers
  • Universal Containers requires that all users add at least one Product Option from the Maintenance Feature to a bundle.
    5·1 answer
  • 4.5 code practice computer science
    5·1 answer
  • To provide for unobtrusive validation, you can install the ____________________ package for unobtrusive validation.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!