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
In bankruptcy, most of a debtor’s assets will probably be used to repay unsecured debt
Juli2301 [7.4K]
This is true. A person in debt could have everything from their home to vehicles to even boats and other possessions taken in order to make up for the money owed. 
5 0
3 years ago
Match the characteristics to the mobile operating system that it describes.
uranmaximum [27]
I think it’s Apple ios
It’s definitely not Microsoft but my guess is Apple
3 0
3 years ago
Use the Law of Sines to solve the triangle. Round your answers to two decimal places.
iris [78.8K]

Answer: 37.1

Explanation: The Law of sines states that there is a proportionality between a side of triangle and its correspondent angle, i.e.:

\frac{a}{sinA} = \frac{b}{sinB} = \frac{c}{sinC}

where:

a, b and c are sides

A, B and C are angles

In the question, there is a triangle with 27.4 as a measure of side a, angles A and C. So, it wants the side c:

\frac{a}{sinA} = \frac{c}{sinC}

\frac{27.4}{sin(99.7)} = \frac{c}{sin(20.4)}

c = \frac{27.4.sin(20.4)}{sin(99.7)}

c = 37.1

The side c is 37.1

5 0
4 years ago
Complete the following:_____
alexira [117]

Answer:

The answer to the give question as follows:

1) \n

2) \t

3) \'

4) \"

5) \\

Explanation:

The description of the above symbols as follows:

  • The \n is used to provide the new line spacing.
  • The \t is used to provide a tab space.
  • To assign a single character value we use \' single.
  • The double \" quote is used to assign a string value.
  • The backslash is used to provide the character of the escape and it also used in a file path.
7 0
3 years ago
Do you want my hero academia?<br><br><br><br><br><br> if so, who's your favorite character :&gt;
VMariaS [17]

Shoto Todoroki and Katsuki Bakugo

4 0
3 years ago
Read 2 more answers
Other questions:
  • Helppppppppppppppppppp
    11·1 answer
  • A friend complains that she is always running out of money even though she “never buys anything expensive.” What advice would yo
    10·1 answer
  • How did the invention of the printing press lead eventually to an increase in the diversity of religious expression?
    7·1 answer
  • The 2 main types of copyright relevant to the recording industry?
    5·2 answers
  • \What will the weather most likely be like the day after a warm front? (4 points) The temperature will be cool or cold, and ther
    7·2 answers
  • Bluetooth © and Wifi are two examples of transmission protocols. Which of the following statements about them is true?
    9·1 answer
  • Does anyone know what to do when brainly won't let you answer questions? I click on answer question and then it just sits there
    15·2 answers
  • What form of communication are they using​
    6·1 answer
  • Which of these lines of code will increment a variable?
    11·1 answer
  • The complete process for learning through repetition is to read, write, say, rest and revisit the information. Please select the
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!