$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #15

What is the correct fix?

def average(nums):
    total = sum(nums)
    return total / len(num)
  1. Change / to //
  2. Change len(num) to len(nums)
  3. Change sum(nums) to sum(num)
  4. Return total only
The parameter is nums; num is undefined.
Play Problem Solving ▸