I'm a beginner in python and using v2.7.2 here's what i tried to execute in the command prompt
p = 2
while(p>0):
for i in range(10):
print i+1 , p
p-=1
The expected output was
1 2
2 1
However the actual output is
1 2
2 1
3 0
4 -1
5 -2
6 -3
7 -4
8 -5
9 -6
10 -7
Why does this happen? and How do i achieve the expected behavior?