if-else statement and code exit
Question: basically I'm quite new to python so I decided to make a simple calculator, I
have done the coding for the calculator and that all works and I am happy,
however I would like an if-else statement to see if they would like to
continue with another calculation. So this is the top part of my code and the
bottom part of my code, I would like to know how to get it so that after the
'else' part of the code, it just runs the rest of the code.

    
    
    import os
    done = ("")
    if done == True:
        os._exit(0)
    else:
        print ("---CALCULATOR---")
    
    ...
    
    done = str(input("Would you like to do another calculation? (Y/N) "))
    if done == "N" or "n":
        done = True
    if done == "Y" or "y":
        done = False
    

Any help would be appreciated.


Answer: You'll want something like this...

    
    
    import os
    done = False
    
    while not done:
        print ("---CALCULATOR---")
        ...
    
        # be careful with the following lines, they won't actually do what you expect
        done = str(input("Would you like to do another calculation? (Y/N) "))
        if done == "N" or "n":
            done = True
        if done == "Y" or "y":
            done = False
    

