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
The following code accomplishes which of the tasks written below? Assume list is an int array that stores positive int values on
worty [1.4K]

Answer:

it stores the largest value in list (the maximum) in foo

Explanation:

Initially foo is assigned as the first element of the list

Inside the loop, every element in the list will be compared with foo, starting from the second element. If an element is greater than foo, the new value of the foo will be that element. At the end of the loop, foo will be equal to the largest element in the list.

5 0
3 years ago
Question Mode Matching Question Match the following description with the appropriate programming language generation. 1GL 1GL dr
erastovalidia [21]

Answer:

1GL: Machine language. Represented by a series of 1s and 0s.

2GL: Assembly language. An assembler converts 2GL into machine language.

3GL: High-level programming language. Uses a compiler to convert into machine language.

4GL: Specifically designed for creating database management programs.

5GL: Extremely advanced. Uses statements (scripts) rather than algorithms.

Explanation:

Programming languages started as a series of binary digits (i.e. 0's and 1'). This generation of language is referred to as the first generation.

However, the machine language were difficult to read by human, so mnemonics were created (i.e. assembly language). This language uses symbolic codes such as ADD for addition, etc. This is the second generation

The third generation are the high level languages that uses languages that can be easily understood by human, e.g. + means plus. However, the language must be translated; hence the need for a compiler or interpreter, as the case may be.

The fourth and fifth generations are extensions of the third generation languages. The fourth were created to connect to DBMS while the fifth are more advanced.

4 0
3 years ago
What is the command to disable any Processes in linix??
stiks02 [169]

Answer: killall[process_name]  or kill[PID]

Explanation:

Killall is a tool for disabling running processes on the system. It will disable all programs that matches the name mentioned.

kill disables processes based on process id numbers. it does not disable the process directly. The process recieves a signal where the process will follow instructions which it has to follow if it receives the signal.

7 0
3 years ago
What’s the purpose of balancing or monitoring your checking account?
emmasim [6.3K]
B) To help you calculate how much money you have in your account.
3 0
3 years ago
Read 2 more answers
Which of the following is the best reason to use a macro?: *
marin [14]

Answer:c)You want to automate a repetitive task to save time

Explanation: Macro is the program that is utilized when there is a requirement of a task or operation to be repeated in a automatic way.This helps in saving the time without commanding the same operation to take place manually.

This program works by taking the into and generating the preset output sequence. Other options are incorrect because it does not help in email functions, correction of the citation in documents or generation of the table.Thus, the correct option is option(c).

7 0
3 years ago
Other questions:
  • given the numerical value 1010101.11, which of the following number systems is most likely represented.
    11·1 answer
  • Amy has decided to use a dark background and light colored text for her prensentation. Which toolbar option will let her change
    5·1 answer
  • The most commonly used video formats are the mpeg-____ format, the windows media audio/video format, and the audio visual interl
    12·1 answer
  • On most computers, the default font size in Word is ____. 8 11 14 16
    6·1 answer
  • Which button will allow you to insert quotes and notes into text into a document​
    12·1 answer
  • What are the useful techniques in program design?
    12·1 answer
  • Casey, a woodworker, is developing his own website. He plans to use the site as a means of selling his handmade furniture. While
    10·1 answer
  • Which routing protocol does an exterior router use to collect data to build its routing tables?
    8·1 answer
  • Which three techniques are used in this photo
    12·1 answer
  • Write the definition of a function that evaluates three double numbers and returns true if the floor of the product of the first
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!