try:
grossCheck = int(input("How much? (figures only pls.)\n"))
except ValueError:
grossCheck = int(input("How much? (FIGURES ONLY PLS.)\n"))
tenPees = grossCheck * 0.1
realPees = grossCheck - tenPees
print("you've got " + str(realPees))
我得到:如何在處理同一個異常時保護我的程序免受其他異常的影響?
ValueError: invalid literal for int() with base 10: 'w'
During handling of the above exception, another exception occurred:
的事情是我之前剛處理相同的異常。 我試圖處理它,以防萬一用戶在不破壞程序的情況下多次輸入錯誤的值。
你需要顯示你的代碼,和完整的追溯。鑑於數據不足。 –