Ad
  • Custom User Avatar

    No, the list of names is already given as a parameter of the function. Read this on how to train on CW

  • Custom User Avatar

    Suppose the given list of numbers doesn't contain any positive numbers.

    There is nothing to sum up, but a return value still needs to be specified.

    The mathematical sum operator $\sum$ is defined to result in 0 if there is nothing to sum up, but not everyone knows that. Some definitions of a sum even have the sum of nothing be undefined.