79475517

Date: 2025-02-28 12:33:12
Score: 2
Natty:
Report link

def nested_sum(lst): total = 0 for item in lst: if isinstance(item, list): total += nested_sum(item) # Recursive call for nested list else: total += item # Add integer value return total

nested_list = [1, [2, 3], [4, [5, 6]], 7] print("Sum:", nested_sum(nested_list))

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Manav Guleria