It's Okay to be average


Hi all,

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

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

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

Thanks in advance!


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


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