I have the following code:
import maya.cmds as cmds
list = cmds.ls(sl=True)
my_list = [object.upper() for object in list]
print(my_list)
However, it doesn't change the name of the objects even though it prints out upper case names in the print statement at the end.