Computer Science, asked by Anonymous, 9 months ago

PYTHON CHALLENGE#2
WRITE A PROGRAM TO PRINT THE SUM OF FIRST N NATURAL NUMBERS

PLEASE DO IT YOURSELF
DON'T USE GOOGLE

YESTERDAY CHALLENGE WINNER: shivangiryan

Answers

Answered by adarshchahal59634
0

Answer:

n=int(input("Enter a number: "))

sum1 = 0

while(n > 0):

sum1=sum1+n

n=n-1

print("The sum of first n natural numbers is",sum1)

Similar questions