MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Identical elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88418] Re: Identical elements
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Mon, 5 May 2008 06:11:12 -0400 (EDT)

On 5/3/08 at 6:17 AM, hussain.alqahtani at gmail.com (KFUPM) wrote:

>I have a list  and i need to test whether all the elements in the
>list are identical or no. What is the efficient way to do that? The
>output should be true if all elements are the same and False
>otherwise. One line command is preferred if possible.

Length[Union@list]==1

will return True if all elements of list are identical and False otherwise


  • Prev by Date: Re: orthonormal eigenvectors
  • Next by Date: Finding the line that caused an error
  • Previous by thread: Re: Identical elements
  • Next by thread: Re: Identical elements