Program wont loop : <pre><code>def main():
        ToDo = []
        ToDo.append("shower")
        ToDo.append("make breakfast")
        ToDo.append("do homework")
        ToDo.append("walk dog") 
        ToDo.append("eat dinner") 
        ToDo.append("sleep") 

        running = True
        ToDo = []
        ToDo.append("shower")
        ToDo.append("make breakfast")
        ToDo.append("do homework")
        ToDo.append("walk dog") 
        ToDo.append("eat dinner") 
        ToDo.append("sleep") 

        running = True

        while(running):
            print("\n1. add an element") 
            print("2. delete an element")
            print("3. edit an element")
            print("4. print an element")
            print("5. exit")    
            choice = int(input("Please enter 1-5: "))
            if choice == 1:
                ToDo.append(input("Enter an element: "))
            elif choice == 2:
                pos = int(input("Please enter the index of the element to delete (0-"+ str(len(ToDo) - 1)+"): "))
                if pos &gt;=0 and pos &lt; len(ToDo):
                    ToDo.pop(pos)
                else:
                    print("Wrong index: " + pos)     
            elif choice == 3:
                pos = int(input("Please enter the index of the element to delete (0-"+ str(len(ToDo) - 1)+"): "))
                if pos &gt;=0 and pos &lt; len(ToDo):
                    ToDo[pos] = input("Enter an element: ")
                else:
                    print("Wrong index: " + pos)  

            elif choice == 4:
                pos = int(input("Please enter the index of the element to delete (0-"+ str(len(ToDo) - 1)+"): "))
                if pos &gt;=0 and pos &lt; len(ToDo):
                    print(ToDo[pos])
                else:
                    print("Wrong index: " + pos)
            elif choice == 5:
                print("Exiting...")
                restart = input("Do you want to start again").lower()
                if restart == "yes":
                    main()
                else:
                    exit()  
            else:
                print("Please enter a valid option")
</code></pre>

<p>My program works the way I want it to, however after adding the following code to loop the entire program, it does not run the program at all. It should run, and if the user enters 5, the program should ask whether they would like to start again. If they say yes then it will go to main otherwise it will end the program: </p>

<pre><code>    restart = input("Do you want to start again").lower()           
    if restart == "yes":
        main()
    else:
        exit()
</code></pre>
