小编Ben*_*enn的帖子

TypeError:'NoneType'对象不可迭代

我得到"类型错误:'NoneType’对象不是可迭代的"上线"公司名称,monthAverage,costPerTon,TOTALCOST = displayCost(公司名称,monthAverage,costPerTon,TOTALCOST)",我不能为我的生命弄清楚为什么.

抱歉,我似乎无法正确格式化...

4-25-11最终项目,全球垃圾计划

主要功能

def main():

    #intialize variables
    endProgram = 'no'
    companyName = 'NONAME'

    #call to input company name
    companyName = inputName(companyName)

    #start 'end program' while loop
    while endProgram == 'no':

        #initializes variables
        companyName = 'NONAME'
        monthAverage = 0
        costPerTon = 0
        totalCost = 0
        yearTotal = 0

        #call to input company name
        companyName = inputName(companyName)

        #call to get the tonnage
        yearTotal, monthAverage = getTonnage(yearTotal, monthAverage)

        #call to calculate the cost
        monthAverage, costPerTon, totalCost, yearTotal = calculateCost(monthAverage, costPerTon, …
Run Code Online (Sandbox Code Playgroud)

python

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

python ×1