<p>晚安,我对<em>while</em>功能有些了解,但我想了解为什么它的主体内的变量会为<em>while</em>主体外的变量刷新新值。是python固有的东西吗?它是这样设计的?你知道吗</p>
<pre><code> 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: "))
</code></pre>