def deepfirst(seq):
 if (not isinstance(seq, (list, tuple))):
  return seq
 else:
  return deepfirst(seq[0])

def deepfirst ( seq ) : if ( not isinstance ( seq , ( list , tuple ) ) ) : return seq else : return deepfirst ( seq [ 0 ] )
first element in a nested list .