I'm new to python and just want to ask if it is possible to use def function to create new variables.
Here is my code, trying to build a function that i can input the variable name and data, it will automaticed output the different list. But it seems not working:
def Length5_list(list_name, a, b, c, d, e):
list_name = list()
list_name = [a, b, c, d, e]
list_name1 = 'first_list'
list_name2 = 'second_list'
A = 1
B = 2
C = 3
D = 4
E = 5
Length5_list(list_name1, A, B, C, D, E)
Length5_list(list_name2, E, D, C, B, A)
print(list_name1, list_name2)
Also wondering if there is any other way to achieve it?
Thank you guys soooo much!