sum, Nr = 0, 12
i = Nr
while i:
sum += i
i -= 1
print ('The sum of all natural numbers up to (and inclusive of) ' + repr(Nr) +
' is ' + repr(sum))
So this is a very simple while loop in python 3 which returns "The sum of all natural numbers up to (and inclusive of) 12 is 78" as expected.
What I am confused about is that why this condition "while i:" works here when "i" is not subjected to any comparison operator.
Thanks!