StudyVerify

GitHub

Problem

Write a Python function `sum_list(nums)` that returns the sum of all integers in the input list. If the list is empty, return 0.

Test Cases

  • [1, 2, 3]6(basic)
  • []0(empty list)
  • [-1, 1, 0]0(negatives + zero)
Calling LLM... (0s)