def row_minimum(x,L): L=L if x==\'1\': row_minimum1=min(L[0],L[1],L[2],L[3],L[4]) return row_minimum1 elif x==\'2\': row_minimum2=min(L[5],L[6],L[7],L
Your code has two nested definitions of user_input, so when you call it you get out the function definition instead of what it is supposed to return. Delete one of the def user_input(y): lines and fix your indentation and I bet it works.
user_input
def user_input(y):