{"id":6835,"date":"2023-10-31T17:17:16","date_gmt":"2023-10-31T11:47:16","guid":{"rendered":"https:\/\/python-programs.com\/?p=6835"},"modified":"2023-11-10T12:09:55","modified_gmt":"2023-11-10T06:39:55","slug":"python-program-to-find-the-sum-of-natural-numbers","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-the-sum-of-natural-numbers\/","title":{"rendered":"Python Program to Find the Sum of Natural Numbers"},"content":{"rendered":"

Natural Number:<\/strong><\/p>\n

A natural number, as the name implies, is a number that occurs often and clearly in nature. It is a whole number with no negative digits.<\/p>\n

Some mathematicians agree that a natural number must contain 0 while others do not. As a result, a list of natural numbers can be described as follows<\/p>\n

N= 1 , 2 , 3 , 4 , 5 etc.<\/pre>\n

Prerequisite:<\/strong><\/p>\n

    \n
  1. For Loop in python<\/a><\/strong><\/li>\n
  2. While Loop in python<\/a><\/strong><\/li>\n<\/ol>\n

    Explore more instances related to python concepts from Python Programming Examples<\/a> Guide and get promoted from beginner to professional programmer level in Python Programming Language.<\/p>\n

    Examples:<\/strong><\/h3>\n

    Example 1:<\/strong><\/p>\n

    Input :<\/strong><\/p>\n

    number = 5<\/pre>\n

    Output:<\/strong><\/p>\n

    Sum of natural numbers till 5 = 15<\/pre>\n

    Example 2:<\/strong><\/p>\n

    Input :<\/strong><\/p>\n

    number = 43<\/pre>\n

    Output:<\/strong><\/p>\n

    Sum of natural numbers till 43 = 946<\/pre>\n

    Program to Find the Sum of Natural Numbers in Python<\/h2>\n

    Below are the ways to print the sum of natural numbers in python:<\/p>\n