コードのこの部分で問題が発生しています。
if(input not in status_list):
print("Invalid Entry, try again.")
break
休憩はプログラム全体を終了します。プログラムの最初に戻りたいだけです(while(1):)
合格、続行、戻りは他に何も考えられません。誰か助けてくれませんか?ありがとう:)
また、この変数の収入を文字列としてまだ読み取っています..:income = int(input("Enter taxable income: "))
私が受け取るエラーメッセージは「TypeError:'str'オブジェクトは呼び出し可能ではありません」です
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)