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
How many grams are in 100 pounds?
stepan [7]

Answer:

45359.2 grams are in 100 pounds

Explanation:

Hope this helped, Have a Wonderful Day!!

3 0
2 years ago
Read 2 more answers
____ is a technology that exists inside another device
Julli [10]

Answer:

Embedded technology is a technology that exists inside another device.

8 0
3 years ago
Read 2 more answers
_____ can be used to convert digitized documents into ASCII (American Standard Code for Information Interchange) text that can b
solniwko [45]

Answer:

Optical Character Recognition

Explanation:

Optical Character Recognition is a method that is used to read character and bar codes. They convert scanned image into digital format. In other words ASCII text can be formed when a digitized document is converted.OCR is a method that convert document into word.

Here are some OCR tools which convert digitized format into machine readable text.

  • Microsoft Document
  • Microsoft One Note

8 0
3 years ago
Jim has excellent oral and written communication skills. He enjoys public speaking and wants a job in which he will interact wit
fredd [130]
The best job for Jim would be public relations specialist.
7 0
3 years ago
Read 2 more answers
Here is the API for a robot library.
marishachu [46]

Answer:

hi

Explanation:

8 0
3 years ago
Other questions:
  • Write statementsto show how finding the length of a character array char [ ] differs from finding the length of a String object
    9·1 answer
  • The logical view of a database system refers tohow a user or programmer conceptually organizes and understands the data. how the
    5·1 answer
  • A complete traversal of an n node binary tree is a(n)____ "operation if visiting a node is O(1)for the iterative implementation
    5·1 answer
  • While working on a group project, you notice something does not look right in the presentation. You call a meeting with your tea
    14·2 answers
  • A database is used instead of a spreadsheet when?
    7·1 answer
  • I have this assignment due TONIGHT BEFORE 10PM! Please help. 50 points for whoever will help!! Here is the assignment.
    7·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • You should always be afraid to use the internet<br><br> True or false?
    11·1 answer
  • During the preventive maintenance phase of a project involving a hydraulic power system, an engineer must change a gasket on a p
    14·1 answer
  • Who is this person?<br><br><br> Kaneppeleqw. I see them everywhere. Are they a bot? Are they human?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!