我现在是一个学习python编程的一年级学生,我们目前正在研究模块/函数。我的代码出现错误:
Traceback (most recent call last): File "C:/Users/User/Desktop/CISC 300 - Dolce/Turn In/A3 Darryl Lardizabal pg121 #4 rework.py", line 86, in <module>
main() File "C:/Users/User/Desktop/CISC 300 - Dolce/Turn In/A3 Darryl Lardizabal pg121 #4 rework.py", line 81, in main
yearly = totalYearly (totalMonthly) File "C:/Users/User/Desktop/CISC 300 - Dolce/Turn In/A3 Darryl Lardizabal pg121 #4 rework.py", line 50, in totalYearly
totalYearly = totalMonthly*ONE_YEAR TypeError: unsupported operand type(s) for *: 'function' and 'float'
我尝试过用多种方式来处理这行代码,包括totatYearly=totalMonthly*12等等,但是不确定它是否就在那里,或者代码有什么问题。在
^{pr2}$谢谢你的帮助!在
^{3}$
当计算年度值并显示结果时,传递的是函数而不是它们的结果作为参数。解决这个问题,它就会起作用:
更新下面是一个简短的示例,说明现在发生了什么,以及上面的解决方法:
^{pr2}$相关问题 更多 >
编程相关推荐