## Sum of postive numbers in python

### Description

```Python program to get input n and n postive integers (skip the negative number), then compute the sum of postive integers
Input:
5
6 7 2 -8 1 8
Ouput:
24```

### Solution

```sum1=0
num=int(input("Enter number:"))
while(num>=0):
sum1+=num
num=int(input("Enter number:"))
print(sum1)

```

We are Teaching "Web Development using Python" through Online.

View Tutor Profile and Course Syllabus

### Explanation

```since 1 is always true, input() statement gets input from user continously,
if user enters a negative number it exit from while loop using break statement.```

#### Author - Ramesh P Natarajan

Software Developer and Technology Trainer, very much passionate in the field of Software Application Development, Machine Learning and Search Engine Optimization.

Write to: [email protected]

### Interesting Pattern Programs: for more Patterns

```Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution```
```Input:
5
Output:
*
***
*****
*******
*********
*******
*****
***
*Solution```
```Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution```
```Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution```
```Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution```
```Input:
5
Output:
*********
*******
*****
***
*
***
*****
*******
*********Solution```