My program crashes(python.exe has stopped working)
Question: So i've made a project for school, and it won't run and i have no idea why.
Everytime i press the "start" button i made, the whole program freezes and
stops working, and seeing as i've made a similar program earlier(this one is
just much cleaner) i get really confused. here is the code:

    
    
    from tkinter import *
    
    root=Tk()
    root.minsize(width=3, height=100)
    root.title("Counter")
    
    list=[]
    list.append(0)
    
    def counter():
        t = 10
        c = 0
        for row in list:
            if (t < 60) or (c < 5):
                l=Label(root, text=t).grid(row=1, column=c)
                t=10+10
                c=0+1
                list.append(t)
        print("") #This is just for debugging purpose
        for row in list:
            if (t < 110) or (c < 10):
                c=0
                ll=Label(root, text=t).grid(row=2, column=c)
                c=0+1
                t+10
                list.append(t)
        return
    
    label=Label(root, text="...").grid(row=0, column=0)
    b=Button(root, text="Start", command=counter).grid(row=0, column=1)
    label=Label(root, text="...").grid(row=0, column=2)
    
    root.mainloop()
    

Thanks for all the tips, figured it out due to you! :D


Answer: The problem is that you're modifying the list you're iterating over. Besides
`list` isn't a good name as it shadows the builtin one, you always append an
element to your list. Additionally, none of the conditions will be met since
`t` is always assigned to `20` and `c` to `1`.

