<p>我正试图编写一个简短的代码,以计算出由于每日利息而达到银行给定本金所需的天数。在空闲状态下运行时,使用下面的代码不会产生任何错误,但计数器返回0。你知道我错过了什么吗?在</p>
<pre><code>def main():
# irrelevant code elided by msw, Bal, Int and Tar are numeric
counter = 0
for i in range(0):
if (Bal * Int) == Tar:
print '1'
else:
counter + 1
print counter
</code></pre>