I am fairly new to python and i am struggling with appending inputs to a list of list. It can do it once but i want it to loop based on the yes or no question. when the list is outputted it doesn't output all inputs:
CategoryList =[['Rent'], ['Daily groceries'], ['Clothing'] ]
Categories = int(input("Please enter one of the following: \n 1 for Rent \n 2 for daily groceries \n 3 for clothing \n 4 to add a category: "))
if Categories == 1 or Categories == 2 or Categories == 3:
Expense1 = input("Enter the amount: ")
Expense1 = int(Expense1)
Choice = input("Would you like to continue yess or no: ")
while Choice != "n":
if Categories == 1:
CategoryList[0].append(Expense1)
if Categories == 2:
CategoryList[1].append(Expense1)
if Categories == 3:
CategoryList[2].append(Expense1)
if Categories == 4:
CategoryNew = input("Enter the name of the new category: ")
Expense = input("Enter the amount: ")
NewAddition = [CategoryNew, Expense]
CategoryList.append(NewAddition)
if Choice =="n":
break
Categories = int(input("Please enter one of the following: \n 1 for Rent \n 2 for daily groceries \n 3 for clothing \n 4 to add a category: "))
if Categories == 1 or Categories == 2 or Categories == 3:
Expense1 = input("Enter the amount: ")
Expense1 = int(Expense1)
Choice1 = input("Would you like to continue yess or no: ")
print(CategoryList)