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 are tone and the meaning of words related? a. The tone of a passage can only be determined if an author uses positive words. b. The tone is based on word ch
What did Charles Darwin discover as a result of his experiments with breeding pigeons? Desirable traits can be selected for and bred in offspring. Humans can cr
What did Elisha the prophet do?
Eleven members of the Middle School Math Club each paid the same amount for a guest speaker to talk about problem solving at their math club meeting. They paid
Which of the following Civil War battles in Georgia was one of the biggest victories for the Confederacy? Savannah Campaign, 1864 Operations against Fort Pulask
why do plants at the bottom of a pond grow better than the plants at the bottom of a lake
How did stone tools change over time? Why do you think these changes took place so slowly?
Mary sold half of her comic books and then bought 9 more. She now has 14. How many did she begin with?
Could a quadrilateral have 4 obtuse angles explanation
What is 86% as a fraction in the simplest form