def lc_choose(index, *args):
 try:
  return args[(int(index) - 1)]
 except Exception as err:
  pass
 if len(args):
  return args[0]
 raise Exception('loncapa_check.lc_choose error, index={index}, args={args}'.format(index=index, args=args))

def lc_choose ( index , * args ) : try : return args [ ( int ( index ) - 1 ) ] except Exception as err : pass if len ( args ) : return args [ 0 ] raise Exception ( 'loncapa_check.lc_choose error, index={index}, args={args}' . format ( index = index , args = args ) )
return args[index] .