lnon = [1, 2, 3, 4] leq = [2, 2, 2, 2] l = lnon l = leq try: for e in l: if e != l[0]: raise print "do your things here cause all elements are the same" except: print "do nothing here cause all elements are NOT the same" pass