Computer Science, asked by hcfgnb2616, 4 months ago

Python program to find sum of 50 natural number.

Answers

Answered by nehabhosale454
28

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):
  8. sum += num.

Explanation:

please mark me brilliant ❤️

Similar questions