0
如何將這些變量返回到主函數? (這是Class的一部分,我不能使用Global,另外我必須打印除main函數以外的錯誤。獲取錯誤,如AssessedTotalValue未分配,PropertyTaxTotal未分配。它用於將Parameter變量獲取到函數中,但爲什麼arn't他們現身其中?我試圖在Python中切換參數而不使用全局變量
def PropertyTax():
global PropertyTaxPercent
PropertyTaxPercent = .64
PropertyValue = int(input("Enter Property Value: "))
AssessedValue(PropertyValue)
PropertyTaxValue(AssessedTotalValue)
print ("The Property Assessed Value is: ", AssessedTotalValue)
print ("The Property Tax is: ", PropertyTaxTotal)
def AssessedValue(PropertyValue):
global AssessedPercentValue
AssessedPercentValue = 0.60
AssessedTotalValue = PropertyValue * AssessedPercentValue
def PropertyTaxValue(AssessedTotalValue):
PropertyTaxValue = AssessedTotalValue/100
PropertyTaxTotal = PropertyTaxValue * PropertyTaxPercent
PropertyTax()
你」我已經瞭解了爭論。現在查找「返回值」。 – user2357112