I am unable to figure out whats wrong in the code and why 6 is not displayed as a perfect number. 

following is my code for printing perfect numbers below 10:

```
    s=0
    for j in range(10):
        for i in range(1,j):
            if j%i==0: 
                s=s+i      #for summing up the factors
        if j==s:
            print(j,'is a perfect number')
        else:
            print(j,'is not a perfect number')

```

Output is :
0 is a perfect number
1 is not a perfect number
2 is not a perfect number
3 is not a perfect number
4 is not a perfect number
5 is not a perfect number
6 is not a perfect number
7 is not a perfect number
8 is not a perfect number
9 is not a perfect number