AlexGaming77201 AlexGaming77201
  • 20-12-2021
  • Computers and Technology
contestada

Write a program that generates 100 random numbers and keeps a count of how many of those random numbers are even and how many of them are odd.

Respuesta :

6385726215
6385726215 6385726215
  • 24-12-2021

Answer:

import random

numbers = []

even = 0

odd = 0

for i in range(100):

   numbers.append(random.randint(1, 200))

for i in range(100):

   if numbers[i] % 2 == 0:

       even += 1

   else:

       odd += 1

print("Even:", even)

print("Odd:", odd)

Explanation:

Gg ez.

Answer Link

Otras preguntas

How does breaking links in an ecosystem affect the amazon rainforest, it's plants, animals and people?
Which electron configuration represents the electrons in an atom of Ga in an excited state?
how many cups is in 48 fluid ounces?
How far north did islam spread in the 600's? How far east?
which of the following is a factor that determines the composition of magma
3b I don't get I know the answer is x=-2 and y=-3 I just can't get it
Suppose you do an experiment to test the effect of soil moisture on seedling growth. You test 3 different soil moisture levels, each with the same type of seed.
Through careful observation, Charles Darwin came to understand that _______________. Select one: a. populations of plants and animals in nature most often consi
a 1 pound weight has a mass of about 0.45 kilograms. a car weighs 2100 pounds. what is the mass of the car in kilograms, rounded nearest tenth of a kilogram?
While looking at a cell under a microscope, a scientist is able to see a biological molecule. This molecule is a nucleic acid with double strands and contains t