I'm trying to create a function that uses one of its parameters to create a global variable with that parameter name. When I try to use the function and input a parameter it just says "name 'Matrix' is not defined"
def Gen2D(name, length):
name = [[0 for j in range(length)] for i in range(length)]
return(name)
Gen2D(Matrix, 12)
I want this to result in a 12 by 12 matrix with variable name "Matrix" but I get the error: "name 'Matrix' is not defined"