while loop in python for do you want to continue

while input("Do You Want To Continue? [y/n]") == "y":
    # do something
    print("doing something")

Here is what the above code is Doing:
1. It asks the user if they want to continue.
2. If the user enters “y”, the program will continue to do something.
3. If the user enters “n”, the program will stop.