#NEWLINE# def parseInputFile( filename ) : #NEWLINE# #INDENT# qids = [ ] #NEWLINE# questions = [ ] #NEWLINE# answers = [ ] #NEWLINE# caption = '' #NEWLINE# i = 0 #NEWLINE# with open ( filename ) as f : #NEWLINE# #INDENT# for line in f : #NEWLINE# #INDENT# if ( ( i == 0 ) and line . startswith ( 'caption:' ) ) : #NEWLINE# #INDENT# caption = line [ 8 : ( - 1 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# parts = line . split ( ',' ) #NEWLINE# qids . append ( int ( parts [ 0 ] ) ) #NEWLINE# questions . append ( parts [ 1 ] ) #NEWLINE# answers . append ( parts [ 2 ] . strip ( '\n' ) ) #NEWLINE# #UNINDENT# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# return ( caption , qids , questions , answers )