Good night, I have some idea about while functionality but I want to understand the why the variables inside its body refresh new values for the variables outside while body. Is something intrinsic of python? It was designed to be like that?
num = int(input("Type a number: "))
while (num != 9999):
add = 0
counter = 0
while (num != 0):
add = add + num
counter += 1
num = int(input("Type another value: "))
print(round(soma/contador,3))
num = int(input("Next sequence of values. Type a number: "))