M.Sc Python Programming Assignment 18
M.Sc Python Programming Assignments Assignment 18 Question: Write a Python program of recursion list sum. Code: def recursive_list_sum(numbers): if len(numbers) == 0: return 0 else: return numbers[0] + recursive_list_sum(numbers[1:]) # Example list my_list = [1, 2, 3, 4, 5] result = recursive_list_sum(my_list) print(“Sum of the list:”, result) Output: Sum of the list: 15