Jan-10-2022, 04:09 PM
It prints only 1 because when you
print("D", f)
the value of the variable f
is the last value that was assigned to f
by a statement f = ...
, and this last value turns out to be 1. Previous values of f are no longer available at that moment.