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])

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))

def Edit(mSales):
    editMonth = input("Three-letter Month: ")
    #index = 0
    months = ['Jan','Feb','Mar','Apr',
    if editMonth not in months:
        print("Invalid three-letter month.")
    new_sales = input("Sales Amount: ")
    #index = months.index(month)
    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
    print("Sales amount for {} was modified".format(editMonth))

import ch06_Monthly_Sales_commandFunctions_CJR as Func

def main():
    #initialize monthly sales list of lists
    monthlySales = [['Jan','616'],['Feb','466'],['Mar','796'], 
    print("Monthly Sales program")
    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':
        elif command == 'monthly':
        elif command == 'yearly':
        elif command == 'edit':
            monthlySales = Func.Edit(monthlySales)
        elif command != 'exit' or 'monthly' or 'yearly' or 'edit':
            print("Invalid command.")


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 :).