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

What is the area of a parallelogram with a base of 2.5 cm and a height of 6 cm?
WHO EVER AWNSERS THIS PLEASE HELP I NEED ALL OF THEM WILL BRAINLIST.
Find the percent of: 17% of 155 and..... 24% of 780
everything is in the picture​
The width of a rectangle is twice the length. The perimeter is 102 feet. Find the dimensions .
208+8x−718+2x SIMPLIFY PLEASE
List four cancer-causing substances found in tobacco products.
wich sentence is an example of indirect characterization​
Explain how studying viruses led to the discovery that DNA contains genetic material
"Fifty-four Forty or Fight" was associated with A) the rush for gold in the Oregon territory in 1854. B) the control of Oregon between the US and Great Britain