It's Okay to be average


#1

Hi all,

I wonder what make these two pieces code different? First one still produces int result.

def average(numbers):
total = sum (numbers)
float(total)
result = total / len(numbers)
floar
return result

def average(numbers):
total = sum(numbers)
return float(total) / len(numbers)

Thanks in advance!


#2

Solved. Thx, guys! :grinning::grinning::grinning::grinning:


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.