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

Please help with this Porfabor ayudame con esto
IMAGE BELOW I WILL MARK BRAINIEST
Classify each item as Contributor to the spread of the Black Death or an Effect of the Black Death. Group of answer choices lack of sanitation increase of rats
what is 1000-300+74+1000-300+5000-1000
In Shakespeare's day, a tragedy was a play which
Which term is used to describe a member of a nation who has all the rights of that nation?
please help me with this
Interview a business owner on the crisis experienced in the workplace. attach an interview schedule a part of your oral presentation
What is in baby formula that is causing a shortage.
Which statement best describes how a catalyst can speed up a chemical reaction? The catalyst decreases the activation energy needed. The catalyst increases the