Why the following codes, first one works and the second one can't be assigned to function call

def average(numbers):

total= float(sum(numbers))

total= total/len(numbers)

return total

def average(numbers):

float(sum(numbers))= total

total/len(numbers)= total

return total