how do i replace the name of multiple objects in a list with names in another list?
Currently your script performs several unnecessary operations when your goal is to rename the objects.


You're creating a set of object names by using the {} syntax, which isn't necessary since the names are guaranteed to be unique.
Unless you intend to re-use the old names, it's not necessary to store them.
You likely don't need to store the new lowercase names either, if you perform your action while iterating over the objects.
Don't use a while loop when you intend to index elements. Use a for loop instead, especially if the object is iterable.
The l is a list of strings, therefore using l() would result in a TypeError, since a list can't be called. It's not a function.


The solution would be to iterate over the objects and rename them one by one.

import bpy


for obj in bpy.context.scene.objects:
    obj.name = obj.name.lower()
    # Perform additional tasks with the renamed object here


If you have to store the lowercase names in a list:

import bpy


names_lowercase = []

for obj in bpy.context.scene.objects:
    name = obj.name.lower()
    obj.name = name
    names_lowercase.append(name)