Blender 2.8 How do I set object/collection active and apply my script for each of collection's objects in via python?
Here is a little commented script to iterate over a collection and populate a second one from copies of the meshes of the first.

import bpy
from math import radians
from random import uniform

# get an existing collection or create it if it does not exist
# if created, the collection is added to the scene main collection
def get_or_create_collection( scene, collection_name ):
    collection = bpy.data.collections.get( collection_name )
    if collection is None:
        collection = bpy.data.collections.new( collection_name )
        scene.collection.children.link( collection )
    return collection

# duplicate an object and link it to a collection
# copy_data allow to know if the objects will share their data or not (are dupli or not)
def duplicate( obj, collection, copy_data ):
    new_obj = obj.copy()
    if copy_data:
        new_obj.data = obj.data.copy()
    collection.objects.link( new_obj )
    return new_obj

# get the scene
scene = bpy.context.scene

# names of the collection
source_collection_name = 'Collection'
destination_collection_name = 'Collection2'

# get the source collection
source_collection = bpy.data.collections.get( source_collection_name )

if source_collection is None:
    print( 'will not work' )
else:
    # get the destination collection
    destination_collection = get_or_create_collection( scene, destination_collection_name )

    # enumerate mesh objects in the source collection
    for obj in [o for o in source_collection.objects if o.type == 'MESH']:
        # get a copy of the object
        new_obj = duplicate( obj, destination_collection, False )
        # ** Make your random transforms here ** 
        rotateX = round(uniform(-20,20), 2)
        rotateY = round(uniform(10,50), 2)
        scaleX = round(uniform(0.3,1), 2)
        scaleY = round(uniform(0.3,1), 2)
        scaleZ = round(uniform(0.3,1), 2)
        new_obj.scale = ( scaleX, scaleY, scaleZ )
        new_obj.rotation_euler = (radians(rotateX),radians(rotateY),radians(-90))