Computer Science, asked by banerjeesubhojit92, 3 months ago

python programming to find the sum of natural number​

Answers

Answered by Attitudequeen01
2

Answer:

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

if num < 0:

print("Enter a positive number")

else:

sum = 0.

# use while loop to iterate un till zero.

while(num > 0):

sum += num.

Explanation:

please mark me as brainlest answer

Similar questions