Question: # Iterators.py # # This program will create a collection of random numbers between 5 and 2 5 , # and then iterate through the

# Iterators.py
#
# This program will create a collection of random numbers between 5 and 25,
# and then iterate through the collection to print the items.
# Imports the necessary modules
import random
# Sets the size of the collection
SIZE =10
# Initializes an empty collection
collection =[]
# Populates the collection with random numbers between 5 and 25
for i in range(SIZE):
collection.append(random.randint(5,25))
# Iterates through the collection and prints the items
for item in collection:
print(item)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!