Variable to function


Hello guys,
I’m having an issue in a python script, and i wonder if someone could help out.

I know i can’t do the following:

var = os.listdir(some_list)
for item in var:
# attempting to create a function per item of the list with it’s name (the function name) to be generated by
#the value of the item.
def item():
print (“print some stuff”)

Is there anyway around that?
Many thanks