# Create and initialize a variable named ‘begin_time’ with the current time.
from datetime import datetime, time, date
from random import randrange
start_time = datetime.today()
#Create an array named ‘ran_nums’ that will hold 800,000 numbers.
ran_nums = []
#Using a loop, generate a random number between 2537 and 7325 (inclusive) and add the random number to ran_nums – iterate 800,000 times.
from random import randint
random = (randint(2537,7325))
print(random)
for n in range(800000):
random = (randint(2537,7325))
ran_nums.append(random)
#Create an arrayList named ‘odd_nums’.
odd_nums = []
#Using a different loop than the one above, traverse ran_nums to check for odd numbers. If a number is odd, append the odd number to odd_nums.
for v in ran_nums:
if v % 2 > 0:
odd_nums.append(v)
break
else:
print("ran_nums is not a odd num")
break
#Create a variable named ‘odd_num_count’ and initialize with the number of elements in odd_nums.
odd_num_count = len(odd_nums)
#Create and initialize a variable named ‘stop_time’ with the current time.
stop_time = datetime.today()
#Create a variable named ‘total_time” and initialize with the difference between stop_time and begin_time.
total_time = stop_time - begin_time
#Run the program and print the following values:
#begin_time
print(begin_time)
#odd_num_count
print(odd_num_count)
#stop_time
print(stop_time)
#total_time (include milliseconds)micosecond
print(total_time)