The following code will output infinite lines of "test".
foo = 5
s = 0
s += t % 10
t //= 10
while condition tests for truth. Any non-zero numeric value is considered true. See the Truth Value Testing section in the Python documentation:
Any object can be tested for truth value, for use in an
whilecondition or as operand of the Boolean operations below. The following values are considered false:
zero of any numeric type, for example,
any empty sequence, for example,
any empty mapping, for example,
instances of user-defined classes, if the class defines a
__len__()method, when that method returns the integer zero or bool value
All other values are considered true — so objects of many types are always true.
Bold emphasis mine.
In your sample
t trends to 0 (integer division by 10), so eventually
while t: ends because
t is considered false.