Not sure what’s wrong here, no matter what I try it returns the TypeError: ‘NoneType’ object is not iterable

The assignment requires me to store the new values in a list and then update the list of lists with them. The program seems to work fine until I call ‘monthly’ after calling ‘edit.’ I’m assuming my problem is somewhere in the ‘edit’ function, but just in case I’m being a doof I’ve included the entirety of my code.

The functions and main method are in separate files

def Monthly(mSales):
    for row in mSales:
        print(row[0] + ' - ' + row[1])
    print()    

def Yearly(mSales):
    total = sum(int(monthlySales) for _, monthlySales in mSales)
    average = total/ len(mSales)
    print("Yearly Total:       ",total)
    print("Monthly Average:    ",round(average, 2))
    print()

def Edit(mSales):
    editMonth = input("Three-letter Month: ")
    #index = 0
    months = ['Jan','Feb','Mar','Apr',
              'Jun','Jul','Aug','Sep',
              'Oct','Nov','Dec']
    if editMonth not in months:
        print("Invalid three-letter month.")
        print()
        return
    new_sales = input("Sales Amount: ")
    #index = months.index(month)
    #print(index)
    new_list = [editMonth, str(new_sales)]
    #mSales[index][1] = new_list
    for i in range(len(mSales)):
        if mSales[i][0] == editMonth:
            mSales[i] = new_list
            break
     
    print("Sales amount for {} was modified".format(editMonth))
    print()

import ch06_Monthly_Sales_commandFunctions_CJR as Func

def main():
    #initialize monthly sales list of lists
    monthlySales = [['Jan','616'],['Feb','466'],['Mar','796'], 
                    ['Apr','238'],['May','310'],['Jun','726'], 
                    ['Jul','987'],['Aug','604'],['Sep','951'], 
                    ['Oct','958'],['Nov','238'],['Dec','610']]
    print("Monthly Sales program")
    print("")
    print("COMMAND MENU")
    print("monthly - View monthly sales")
    print("yearly  - View yearly summary")
    print("edit    - Edit sales for a month")
    print("exit    - Exit program")
    print(" ")

    while True:
        command = input("Command: ")
        #if statements correlating to command functions
        if command == 'exit':
            print("Bye!")
            break 
        elif command == 'monthly':
            Func.Monthly(monthlySales)
        elif command == 'yearly':
            Func.Yearly(monthlySales)
        elif command == 'edit':
            monthlySales = Func.Edit(monthlySales)
        elif command != 'exit' or 'monthly' or 'yearly' or 'edit':
            print("Invalid command.")

Answer

You don’t return anything from Edit and that None result gets assigned to monthlySales, which you pass into Monthly() on the next call, causing the error.

If you add return mSales to your Edit() function, your code works as expected.

Your code has some style issues as well, but that’s well beyond the scope of what you’re asking :).