# the general way to loop until the user does a thing.
done = False
count = 1
while(not done):
    # do a thing
    if not (10 < (count % 100) < 14):
        # handle the pesky English grammar
        if(count % 10 == 1):
            num_end = "st"
        elif(count % 10 == 2):
            num_end = "nd"
        elif(count % 10 == 3):
            num_end = "rd"
        else:
            num_end = "th"
    else:
        num_end = "th"
    print("Here I go for the", str(count)+num_end, "time.")

    # this is only needed for the output
    count += 1

    # are we done?
    good_input = False
    while(not good_input):
        user_action = input("Do another thing?(y/n): ")
        if user_action == 'y':
            done = False
            good_input = True
        elif user_action == 'n':
            done = True
            good_input = True
        else:
            print("*** EGREGIOUS USER ERROR ***\nThat wasn't a valid input, try again...")

print("We're done and outside the loop.\nGOODBYE!")
