我的这部分代码有问题:
if(input not in status_list):
print("Invalid Entry, try again.")
break
break 退出整个程序,我只想回到程序的开头(到while(1):)
我试过 pass,continue,return 想不出别的了。。谁能帮忙??谢谢:)
它还在将这个变量收入作为字符串读取..:income = int(input("Enter taxable income: "))
我收到的错误消息是“TypeError:'str' object is not callable”
import subprocess
status_list = ["s","mj","ms","h"]
while(1):
print ("\nCompute income tax: \n")
print ("Status' are formatted as: ")
print ("s = single \n mj = married and filing jointly \n ms = married and filing seperately \n h = head of household \n q = quit\n")
input = input("Enter status: ")
if(input == 'q'):
print("Quitting program.")
break
if(input not in status_list):
print("Invalid Entry, try again.")
break
income = int(input("Enter taxable income: "))
income.replace("$","")
income.replace(",","")
#passing input to perl files
if(input == 's'):
subprocess.call("single.pl")
elif(input == 'mj'):
subprocess.call("mj.pl", income)
elif(input == 'ms'):
subprocess.call("ms.pl", income)
else:
subprocess.call("head.pl", income)