def ask(question='Continue? (y/n): ', allowed=None):
    """ Ask the question until it returns one of the allowed responses """
    while True:
        ans = input(question)
        if ans.lower() in (allowed if allowed else ['y', 'n']):
            return ans
