python programming to find the sum of natural number
Answers
Answered by
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