Why the print of this code is 3 3 3
? In the last for
loop, the variable D
should increase in 1 and then update the value, until the end of the loop. But it's repeating the same initial value of D
. I was expecting something 3 4 5
as result.
for j in range(0,2,1):
D = 1
D +=1
"""D = 2"""
def calculo222(H):
H += 1
print(H)
for i in range(0,3,1):
calculo222(D)