What behavior should be expected from this code?
Floor division of 1 by 3 evaluates to 0, and str(0) is '0'. The loop leaves dummy as '0', and dummy[-1] retrieves its last character, which is printed as 0.
1
3
0
str(0)
'0'
dummy
dummy[-1]
Community Discussion