Write a program in python to find the sum of first 10 natural numbers
Answers
Answered by
3
Answer:
1 num = int(input("Enter a number: "))
2 if num < 0:
3 print("Enter a positive number")
4 else:
5 sum = 0.
6# use while loop to iterate un till zero.
7 while(num > 0):
sum += num.
Similar questions