def pseudo_input(lines):
 ilines = iter(lines)
 def raw_in(prompt):
  try:
   return next(ilines)
  except StopIteration:
   return ''
 return raw_in

def pseudo_input ( lines ) : ilines = iter ( lines ) def raw_in ( prompt ) : try : return next ( ilines ) except StopIteration : return '' return raw_in
return a function that acts like raw_input but feeds the input list .