#NEWLINE# def prompt( self , msg ) : #NEWLINE# #INDENT# answer = input ( ( '%s (y/n) ' % msg ) ) . lower ( ) . strip ( ) #NEWLINE# while ( self not in [ 'y' , 'n' ] ) : #NEWLINE# #INDENT# print ( 'Invalid answer "{}".' . format ( answer ) ) #NEWLINE# answer = input ( ( '%s (y/n) ' % msg ) ) . lower ( ) . strip ( ) #NEWLINE# #UNINDENT# return ( answer == 'y' )