這裏是我的編碼:Python算法3.2 - 請幫我解決錯誤。
def main():
actualValued()
assessed_value()
printResult()
def actualValued():
global assessed_value
global property_tax
assessed_value = 0.6 * actualValue
property_tax = assessed_value/100*0.64
def printResult():
print("For a property valued at"), actualValued
print("The assessed value is"), asessed_value
print("The property tax is"), property_tax
actualValue = None
assessed_value = None
property_tax = None
main()
的錯誤:
Traceback (most recent call last):
File "C:/Documents and Settings/Desktop/property tax.py", line 21, in <module>
main()
File "C:/Documents and Settings/Desktop/property tax.py", line 2, in main
actualValued()
File "C:/Documents and Settings/Desktop/property tax.py", line 9, in actualValued
assessed_value = 0.6 * actualValue
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
>>>
我所試圖做的事:
回車評估值爲10000.0 對於價值$ 10,000.00 的評估值的屬性是$ 6,000.00 而稅是$ 38.40
物業稅:一個縣徵收物業評估價值的財產稅,這是物業實際價值的60%。例如,如果一英畝土地的價值爲10,000美元,則其評估價值爲6,000美元。對於每100美元的評估價值,物業稅是64%。評估價爲6,000美元的英畝稅將爲38.40美元。
我需要該物業的實際價值和顯示評估價值和物業稅。
功能,我需要使用:
- 一個從用戶
- 一個獲得輸入計算所有值
- 一個輸出結果
- 和主函數來調用三個其他功能
它的蟒蛇3.0 –