所以我试图做一个简单的循环,由于某种原因,我似乎无法理解为什么会出现错误消息。
earnings = [94500,65377,84524]
deductions = [20000,18000,19000]
tax = [] #empty list
i = -1 #iterative counter
while True:
i=i+1
if (earnings[i] > 23000):
tax.append(0.14*earnings[i])
continue
else:
break
print ('Tax calculation has been completed')
print ('Number of iterations: ',i)
我觉得它与这条线有关, if (earnings[i] > 23000) 但我不知道我将如何操纵它。
扬帆大鱼
莫回无
慕斯709654
随时随地看视频慕课网APP
相关分类