---
title: "Discussion on \"Python Recursion question  1\" | Hashnode"
description: "Discussion on \"Python Recursion question  1\". Write a Python program to calculate the sum of a list of numbers.\ndef list_sum(num_List):    if len(num_List) == 1:        return num_List[0]    else:        return num_List[0] + list_sum(num_List[1:])        print(list_sum([2, 4, 5, 6, 7]))"
url: "https://hashnode.com/posts/python-recursion-question-1/63c6925e691ee062c2d4ea35"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python Recursion question 1](https://amankesharwani.hashnode.dev/python-recursion-question-1?utm_source=hashnode&utm_medium=feed)

Write a Python program to calculate the sum of a list of numbers. def list\_sum(num\_List):    if len(num\_List) == 1:        return num\_List\[0\]    else:        return num\_List\[0\] + list\_sum(num\_List\[1:\])        print(list\_sum(\[2, 4, 5, 6, 7\]))

Jan 17, 2023 · 1 min read · amankesharwani.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#python-projects](https://hashnode.com/tag/python-projects)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)
-   [#python-libraries](https://hashnode.com/tag/python-libraries)

## Written by

[AMAN KESHARWANI](https://hashnode.com/@Amank)

@Amank

  
[View profile](https://hashnode.com/@Amank)

Full stack web developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
