Header Ads

Python Program to Find The Sum of Natural Numbers 1 to 10 Using While Loop

Python, Program,Find, Sum, average, Natural,  Numbers,While, for, Loop,
Python Program, Find The Sum,  Natural Numbers, While Loop, Display Natural number, Display Nutural Number and Their Sum, Display Nutural Number and Their Sum and Average, Python Program to Find The Sum of Natural Numbers 1 to 10 Using While Loop

Write a program to Display Number From 1 to 10 and Their Sum Using While Loop Using Python

Example: Program Code




num = 1

sum = 0

while num <= 10:

    print(num)

    sum += num

    num += 1

print("The Sum is :", sum)



Output




Python Program, Find The Sum,  Natural Numbers, While Loop, Display Natural number, Display Nutural Number and Their Sum, Display Nutural Number and Their Sum and Average, Python Program to Find The Sum of Natural Numbers 1 to 10 Using While Loop

No comments

Powered by Blogger.