#NEWLINE# def get_confirmation( question ) : #NEWLINE# #INDENT# "\n    Will pose the question to the user and keep asking them until they\n    provide an answer that starts with either a 'y' or an 'n', at which\n    point it will return True if it was a 'y'.\n    " #NEWLINE# while True : #NEWLINE# #INDENT# response = input ( ( '%s (y/n): ' % question ) ) . lower ( ) #NEWLINE# if ( re . match ( '^[yn]' , response ) is not None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# print ( ( "Incorrect option '%s'" % response ) ) #NEWLINE# #UNINDENT# return ( response [ 0 ] == 'y' )