MathGroup Archive 2008

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

Search the Archive

Re: Identical elements

  • To: mathgroup at
  • Subject: [mg88439] Re: Identical elements
  • From: "David Park" <djmpark at>
  • Date: Mon, 5 May 2008 06:15:00 -0400 (EDT)
  • References: <fvhe2h$3th$>

list1 = {a, b, c};
list2 = {b, b, b};

SameQ @@ list1

SameQ @@ list2

@@ is Apply.

David Park
djmpark at

"KFUPM" <hussain.alqahtani at> wrote in message 
news:fvhe2h$3th$1 at
> Dear All
> 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.
> Your help is highly appreciated.
> Regards,

  • Prev by Date: Re: Identical elements
  • Next by Date: Re: Help with Manipulate
  • Previous by thread: Re: Identical elements
  • Next by thread: Re: Identical elements