0
Why does this code have 4 numbers in output rather than 5...where does -1 in output go?
Why does this code have 4 numbers in output rather than 5...where does -1 in output go? https://code.sololearn.com/cz5w4zHWT91V/?ref=app
1 Resposta
+ 2
See how loop working your values are decreasing continuously from 3
2
1
0
When u reached at 0 here
While0>=0 its true so last valuw 0 will print then it will decrease
while i>=0:
print (i)
i=i-1 //0-0 which is -1
But when condition will check in while
Like while -1>0 its false that's why its not printing